Product SiteDocumentation Site

8.75. SysToUnicode (Windows only)


>>-SysToUnicode--(--string, codepage, translateflags, outstem--)-><

Maps a character string to a UNICODE string.
Parameters:
string
A string containing the UNICODE characters to be mapped.
codepage
Specifies the code page used to perform the conversion. This parameter can be the value of any code page that is installed or available in the system. The default is the current original equipment manufacturer (OEM) code-page identifier for the system.
You can also specify one of the following values:
ACP
ANSI code page.
OEMCP
OEM code page.
SYMBOL
Windows 2000: symbol code page.
THREAD_ACP
Windows 2000: current thread's ANSI code page.
UTF7
Windows NT 4.0 and Windows 2000: translate using UTF-7.
UTF8
Windows NT 4.0 and Windows 2000: translate using UTF-8. When this is set, translateflags must be set.
translateflags
Indicates whether to translate to precomposed or composite-wide characters (if a composite form exists), whether to use glyph characters in place of control characters, and how to deal with invalid characters.
You can specify a combination of the following flags:
PRECOMPOSED
Always use precomposed characters, that is, characters in which a base character and a nonspacing character have a single character value. This is the default translation option. Cannot be used with COMPOSITE.
COMPOSITE
Always use composite characters, that is, characters in which a base character and a nonspacing character have different character values. Cannot be used with PRECOMPOSED.
ERR_INVALID_CHARS
If the function encounters an invalid input character, it fails and returns "1113".
USEGLYPHCHARS
Use glyph characters instead of control characters.
A composite character consists of a base character and a nonspacing character, each having different character values. A precomposed character has a single character value for a base-nonspacing character combination. In the character è, the "e" is the base character and the "grave" accent mark is the nonspacing character. The function's default behavior is to translate to the precomposed form. If a precomposed form does not exist, the function attempts to translate to a composite form.
The flags PRECOMPOSED and COMPOSITE are mutually exclusive. The USEGLYPHCHARS flag and the ERR_INVALID_CHARS can be set regardless of the state of the other flags.
outstem
The name of the stem variable that will contain the converted result. If the conversion was successful the stem will be composed of the following value(s):
outstem.!TEXT
This variable will contain the converted string.
Return codes:
0
No errors.
Other
An error occurred. A Windows System Error code (Section 8.1, “A Note on Error Codes”) is returned. This may be one of the following, but could be others.
87
Incorrect code page or codepage value.
1004
Invalid translate flags.
1113
No mapping for the Unicode character exists in the target code page.