Defines |
| #define | NDEBUG |
Functions |
|
Construct a name of NLS section.
- Parameters:
-
| CodePage | Code page number. |
| Base | Integer base used for converting to string. Usually set to 10. |
| Unknown | As the name suggests the meaning of this parameter is unknown. The native version of Kernel32 passes it as the third parameter to NlsConvertIntegerToString function, which is used for the actual conversion of the code page number. |
| BaseName | Base name of the section. (ex. "\\Nls\\NlsSectionCP") |
| Result | Buffer that will hold the constructed name. |
| ResultSize | Size of the buffer for the result. |
- Returns:
- TRUE if the buffer was large enough and was filled with the requested information, FALSE otherwise.
|
| BOOL WINAPI | GetNlsSectionName (UINT CodePage, UINT Base, ULONG Unknown, LPSTR BaseName, LPSTR Result, ULONG ResultSize) |
|
Get file name of code page definition file.
- Parameters:
-
| CodePage | Code page number to get file name of. |
| FileName | Buffer that is filled with file name of successful return. Can be set to NULL. |
| FileNameSize | Size of the buffer to hold file name in WCHARs. |
- Returns:
- TRUE if the file name was retrieved, FALSE otherwise.
|
| BOOL WINAPI | GetCPFileNameFromRegistry (UINT CodePage, LPWSTR FileName, ULONG FileNameSize) |
|
Internal NLS related stuff initialization.
|
| BOOL FASTCALL | NlsInit (VOID) |
|
Internal NLS related stuff uninitialization.
|
| VOID FASTCALL | NlsUninit (VOID) |
|
Internal function to get structure containing a code page information of code page that is already loaded.
- Parameters:
-
| CodePage | Number of the code page. Special values like CP_OEMCP, CP_ACP or CP_UTF8 aren't allowed. |
- Returns:
- Code page entry or NULL if the specified code page hasn't been loaded yet.
|
| PCODEPAGE_ENTRY FASTCALL | IntGetLoadedCodePageEntry (UINT CodePage) |
|
Internal function to get structure containing a code page information.
- Parameters:
-
| CodePage | Number of the code page. Special values like CP_OEMCP, CP_ACP or CP_THREAD_ACP are allowed, but CP_UTF[7/8] isn't. |
- Returns:
- Code page entry.
|
| PCODEPAGE_ENTRY FASTCALL | IntGetCodePageEntry (UINT CodePage) |
|
Internal version of MultiByteToWideChar for UTF8.
- See also:
- MultiByteToWideChar
- Todo:
- Add UTF8 validity checks.
|
| static INT WINAPI | IntMultiByteToWideCharUTF8 (DWORD Flags, LPCSTR MultiByteString, INT MultiByteCount, LPWSTR WideCharString, INT WideCharCount) |
|
Internal version of MultiByteToWideChar for code page tables.
- See also:
- MultiByteToWideChar
- Todo:
- Handle MB_PRECOMPOSED, MB_COMPOSITE, MB_USEGLYPHCHARS and DBCS codepages.
|
| static INT WINAPI | IntMultiByteToWideCharCP (UINT CodePage, DWORD Flags, LPCSTR MultiByteString, INT MultiByteCount, LPWSTR WideCharString, INT WideCharCount) |
|
Internal version of MultiByteToWideChar for SYMBOL.
- See also:
- MultiByteToWideChar
|
| static INT WINAPI | IntMultiByteToWideCharSYMBOL (DWORD Flags, LPCSTR MultiByteString, INT MultiByteCount, LPWSTR WideCharString, INT WideCharCount) |
|
Internal version of WideCharToMultiByte for SYMBOL.
- See also:
- WideCharToMultiByte
|
| static INT WINAPI | IntWideCharToMultiByteSYMBOL (DWORD Flags, LPCWSTR WideCharString, INT WideCharCount, LPSTR MultiByteString, INT MultiByteCount) |
|
Internal version of WideCharToMultiByte for UTF8.
- See also:
- WideCharToMultiByte
|
| static INT WINAPI | IntWideCharToMultiByteUTF8 (UINT CodePage, DWORD Flags, LPCWSTR WideCharString, INT WideCharCount, LPSTR MultiByteString, INT MultiByteCount, LPCSTR DefaultChar, LPBOOL UsedDefaultChar) |
|
Checks if ch (single-byte character) is a valid mapping for wch
- See also:
- IntWideCharToMultiByteCP
|
| static BOOL | IntIsValidSBCSMapping (PCPTABLEINFO CodePageTable, DWORD Flags, WCHAR wch, UCHAR ch) |
|
Checks if ch (double-byte character) is a valid mapping for wch
- See also:
- IntWideCharToMultiByteCP
|
| static BOOL | IntIsValidDBCSMapping (PCPTABLEINFO CodePageTable, DWORD Flags, WCHAR wch, USHORT ch) |
|
Internal version of WideCharToMultiByte for code page tables.
- See also:
- WideCharToMultiByte
- Todo:
- Handle WC_COMPOSITECHECK
|
| static INT WINAPI | IntWideCharToMultiByteCP (UINT CodePage, DWORD Flags, LPCWSTR WideCharString, INT WideCharCount, LPSTR MultiByteString, INT MultiByteCount, LPCSTR DefaultChar, LPBOOL UsedDefaultChar) |
|
Internal function to detect if byte is lead byte in specific character table.
|
| static BOOL WINAPI | IntIsLeadByte (PCPTABLEINFO TableInfo, BYTE Byte) |
|
Convert a wide-charater string to closest multi-byte equivalent.
- Parameters:
-
| CodePage | Code page to be used to perform the conversion. It can be also one of the special values (CP_ACP for ANSI code page, CP_MACCP for Macintosh code page, CP_OEMCP for OEM code page, CP_THREAD_ACP for thread active code page, CP_UTF7 or CP_UTF8). |
| Flags | Additional conversion flags (WC_NO_BEST_FIT_CHARS, WC_COMPOSITECHECK, WC_DISCARDNS, WC_SEPCHARS, WC_DEFAULTCHAR). |
| WideCharString | Points to the wide-character string to be converted. |
| WideCharCount | Size in WCHARs of WideCharStr, or 0 if the caller just wants to know how large WideCharString should be for a successful conversion. |
| MultiByteString | Points to the buffer to receive the translated string. |
| MultiByteCount | Specifies the size in bytes of the buffer pointed to by the MultiByteString parameter. If this value is zero, the function returns the number of bytes required for the buffer. |
| DefaultChar | Points to the character used if a wide character cannot be represented in the specified code page. If this parameter is NULL, a system default value is used. |
| UsedDefaultChar | Points to a flag that indicates whether a default character was used. This parameter can be NULL. |
- Returns:
- Zero on error, otherwise the number of bytes written in the MultiByteString buffer. Or the number of bytes needed for the MultiByteString buffer if MultiByteCount is zero.
|
| INT WINAPI | WideCharToMultiByte (UINT CodePage, DWORD Flags, LPCWSTR WideCharString, INT WideCharCount, LPSTR MultiByteString, INT MultiByteCount, LPCSTR DefaultChar, LPBOOL UsedDefaultChar) |
|
Get active ANSI code page number.
|
| UINT WINAPI | GetACP (VOID) |
|
Get active OEM code page number.
|
| UINT WINAPI | GetOEMCP (VOID) |
|
Determine if passed byte is lead byte in current ANSI code page.
|
| BOOL WINAPI | IsDBCSLeadByteEx (UINT CodePage, BYTE TestByte) |
| BOOL WINAPI | IsDBCSLeadByte (BYTE TestByte) |
| NTSTATUS WINAPI | CreateNlsSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG Size, ULONG AccessMask) |
| BOOL WINAPI | IsValidUILanguage (LANGID langid) |
| VOID WINAPI | NlsConvertIntegerToString (ULONG Value, ULONG Base, ULONG strsize, LPWSTR str, ULONG strsize2) |
| UINT WINAPI | SetCPGlobal (UINT CodePage) |
| BOOL WINAPI | ValidateLCType (int a1, unsigned int a2, int a3, int a4) |
| BOOL WINAPI | NlsResetProcessLocale (VOID) |
| VOID WINAPI | GetDefaultSortkeySize (LPVOID lpUnknown) |
| VOID WINAPI | GetLinguistLangSize (LPVOID lpUnknown) |
| BOOL WINAPI | ValidateLocale (IN ULONG LocaleId) |
| ULONG WINAPI | NlsGetCacheUpdateCount (VOID) |
| BOOL WINAPI | IsNLSDefinedString (IN NLS_FUNCTION Function, IN DWORD dwFlags, IN LPNLSVERSIONINFO lpVersionInformation, IN LPCWSTR lpString, IN INT cchStr) |
| BOOL WINAPI | GetNLSVersion (IN NLS_FUNCTION Function, IN LCID Locale, IN OUT LPNLSVERSIONINFO lpVersionInformation) |
Variables |
| static const char | UTF8Length [128] |
| static const unsigned char | UTF8Mask [6] = {0x7f, 0x1f, 0x0f, 0x07, 0x03, 0x01} |
| static LIST_ENTRY | CodePageListHead |
| static CODEPAGE_ENTRY | AnsiCodePage |
| static CODEPAGE_ENTRY | OemCodePage |
| static RTL_CRITICAL_SECTION | CodePageListLock |
IsValidCodePage |
Detect if specified code page is valid and present in the system.
- Parameters:
-
| CodePage | Code page number to query. |
- Returns:
- TRUE if code page is present.
|
| static const signed char | base64inv [] |
| BOOL WINAPI | IsValidCodePage (UINT CodePage) |
| static VOID | Utf7Base64Decode (BYTE *pbDest, LPCSTR pszSrc, INT cchSrc) |
| static VOID | myswab (LPVOID pv, INT cw) |
| static INT | Utf7ToWideCharSize (LPCSTR pszUtf7, INT cchUtf7) |
| static INT | Utf7ToWideChar (LPCSTR pszUtf7, INT cchUtf7, LPWSTR pszWide, INT cchWide) |
MultiByteToWideChar |
Convert a multi-byte string to wide-charater equivalent.
- Parameters:
-
| CodePage | Code page to be used to perform the conversion. It can be also one of the special values (CP_ACP for ANSI code page, CP_MACCP for Macintosh code page, CP_OEMCP for OEM code page, CP_THREAD_ACP for thread active code page, CP_UTF7 or CP_UTF8). |
| Flags | Additional conversion flags (MB_PRECOMPOSED, MB_COMPOSITE, MB_ERR_INVALID_CHARS, MB_USEGLYPHCHARS). |
| MultiByteString | Input buffer. |
| MultiByteCount | Size of MultiByteString, or -1 if MultiByteString is NULL terminated. |
| WideCharString | Output buffer. |
| WideCharCount | Size in WCHARs of WideCharString, or 0 if the caller just wants to know how large WideCharString should be for a successful conversion. |
- Returns:
- Zero on error, otherwise the number of WCHARs written in the WideCharString buffer.
|
| static const char | mustshift [] |
| static const char | base64 [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" |
| INT WINAPI | MultiByteToWideChar (UINT CodePage, DWORD Flags, LPCSTR MultiByteString, INT MultiByteCount, LPWSTR WideCharString, INT WideCharCount) |
| static INT | WideCharToUtf7Size (LPCWSTR pszWide, INT cchWide) |
| static INT | WideCharToUtf7 (LPCWSTR pszWide, INT cchWide, LPSTR pszUtf7, INT cchUtf7) |
| static BOOL | GetLocalisedText (DWORD dwResId, WCHAR *lpszDest) |
| BOOL WINAPI | GetCPInfo (UINT CodePage, LPCPINFO CodePageInfo) |
| BOOL WINAPI | GetCPInfoExW (UINT CodePage, DWORD dwFlags, LPCPINFOEXW lpCPInfoEx) |
| BOOL WINAPI | GetCPInfoExA (UINT CodePage, DWORD dwFlags, LPCPINFOEXA lpCPInfoEx) |