Converts an ANSI or UNICODE string to UTF-8.
MyUNICODEString is UNICODE string = "beginning"
// MyUNICODEString contains the set of bytes: 0064 00E9 0062 0075 0074
MyStringInUTF8 is Buffer = StringToUTF8(MyUNICODEString)
// MyStringInUTF8 contains the set of bytes: 64 C3 A9 62 75 74
// The character "é" was encoded in C3 A9
Syntax
<Result> = StringToUTF8(<String to convert> [, <Charset of string to convert>])
<Result>: Character string or Buffer
- Character string or buffer in UTF-8 format,
- EOT if conversion problems occurred.
<String to convert>: Character string
String to convert to UTF-8.
<Charset of string to convert>: Optional integer
Source character set of string to convert. By default, this parameter corresponds to the charsetCurrent constant (specified in ChangeCharset). | |
charsetAnsi | Roman characters in ANSI standard |
charsetArabic | Arabic characters |
charsetBaltic | Baltic characters |
charsetChinese | Chinese characters (People's Republic of China) |
charsetCurrent (Default value) | Uses the current character set specified with ChangeCharset (charsetOccidental by default) |
charsetDefault | Uses the computer's default character set. No character set is forced. |
charsetEastEurope | Eastern Europe characters (Polish, etc.) |
charsetGreek | Greek characters |
charsetHebrew | Hebrew characters |
charsetJapanese | Japanese characters |
charsetKorean | Korean characters |
charsetRussian | Russian characters |
charsetThai | Thai characters |
charsetTraditionalChinese | Traditional Chinese characters (Republic of Taiwan) |
charsetTurkish | Turkish characters |
charsetUTF8 | Used to manage UTF-8 (used in XML, for example). |
charsetVietnamese | Vietnamese characters |