Home |
RTTarget-32 Programming Manual Function RTSetFileApisTo Function RTSetDLLNameTranslation System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) |
Function RTSetFileApisToFunction RTSetFileApisTo can be used to set a code page and to supply translation tables for file names passed to the widechar (Unicode) version of the Win32 File I/O API. If this function is never called, OEM code page 437 is assumed by default. void RTSetFileApisTo(int CodePage, const WORD * Unicode); ParametersCodePageNumeric name of the code page. For UTF-8, use CP_UTF8 (65001). For the standard OEM code page, use CP_OEMCP or 437. For ANSI, use CP_ACP or 1252. Any other value is also allowed to support arbitrary code pages. UnicodePointer to an array of exactly 128 WORD values. This array must contain the Unicode translations of the 8-bit ASCII values in range 128 .. 255. RTTarget-32 will translate ASCII character values above 127 to Unicode with: Unicode[(BYTE) c - 128]. For UTF-8, this parameter should be NULL. The implementation of Win32 API functions SetFileApisToOEM and SetFileApisToANSI use this function like this: WINBASEAPI VOID WINAPI SetFileApisToOEM(VOID) { RTSetFileApisTo(437, UnicodeMap437); } WINBASEAPI VOID WINAPI SetFileApisToANSI(VOID) { RTSetFileApisTo(1252, UnicodeMap1252); } To translate all Unicode file names to UTF-8, use: RTSetFileApisTo(CP_UTF8, NULL); Win32 API functions MultiByteToWideChar and WideCharToMultiByte always support code pages CP_ACP/1252, CP_OEMCP/437, and CP_UTF8/65001. If a different code page is installed through the last call to function RTSetFileApisTo, then that code page is also supported by MultiByteToWideChar and WideCharToMultiByte.
|