UTF8StrToMBStrBuf
- Updated2023-02-21
- 1 minute(s) read
UTF8StrToMBStrBuf
int UTF8StrToMBStrBuf (const char UTF8String[], char multibyteString[], size_t bufferSizeInBytes, int flags);
Purpose
Converts a UTF-8 encoded string to an ANSI encoded, multibyte string using the native character set and stores the converted string in the buffer.
The native character set corresponds to the selected language in the Control Panel for non-Unicode programs.
Parameters
Input | ||
Name | Type | Description |
UTF8String | const char [] | The UTF-8 Null-terminated string you want to convert. |
bufferSizeInBytes | size_t | Number of bytes in the ansiStr parameter. |
flags | int | Flags indicating the conversion type. Setting flags to kErrInvalidChars makes the function fail if an invalid input character is encountered. |
Output | ||
Name | Type | Description |
multibyteString | char [] | Buffer to receive the null-terminated string encoded in ANSI multibyte. |
Return Value
Name | Type | Description | ||||||||||||
status | int | Result of the conversion.
|
Additional Information
Library: Utility Library
Include file: utility.h
LabWindows/CVI compatibility: LabWindows/CVI 2020 and later
Example
Refer to utility\StringConversions\StringConversions.cws for an example of using the UTF8StrToMBStrBuf function.