Difference between revisions of "Unit Locale"
Line 179: | Line 179: | ||
</div></div> | </div></div> | ||
<br /> | <br /> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Default locale constants''' <code> LOCALE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>LOCALE_SYSTEM_DEFAULT = $800;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>LOCALE_USER_DEFAULT = $400;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''String length maximum constants''' <code> MAX_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>MAX_LEADBYTES = 12;</code> | ||
+ | | 5 ranges, 2 bytes each, 0 terminated | ||
+ | |- | ||
+ | | <code>MAX_DEFAULTCHAR = 2;</code> | ||
+ | | single or double byte | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === |
Revision as of 03:32, 25 November 2016
Return to Unit Reference
Description
This unit implements the locale support for Ultibo and provides the code page support for the WideStringManager/UnicodeStringManager interface for the RTL.
This unit provides compatible implementations of the following functions:
- ConvertDefaultLocale
- EnumCodePagesProc
- EnumLocalesProc
- EnumTimeFormats
- GetCPInfo
- GetNumberFormat
- GetSystemDefaultLangID
- GetUserDefaultLangID
- IsValidLocale
- GetConsoleOutputCP
- EnumCalendarInfo
- EnumDateFormats
- EnumSystemCodePages
- EnumTimeFormatsProc
- GetCurrencyFormat
- GetLocaleInfo
- GetSystemDefaultLCID
- GetUserDefaultLCID
- SetLocaleInfo
- SetConsoleCP
- EnumCalendarInfoProc
- EnumDateFormatsProc
- EnumSystemLocales
- GetACP
- GetDateFormat
- GetOEMCP
- GetTimeFormat
- IsValidCodePage
- GetConsoleCP
- SetConsoleOutputCP
The following functions are implemented by the Threads unit:
- GetThreadLocale (ThreadGetLocale) (GetThreadLocale is exposed in the Ultibo unit)
- SetThreadLocale (ThreadSetLocale) (SetThreadLocale is exposed in the Ultibo unit)
Most of the above are currently not implemented.
OEM Code Page defaults to 437 (OEM United States)
ANSI Code Page defaults to 1252 (ANSI Latin 1; Western European (Windows))
See also: https://msdn.microsoft.com/en-us/library/windows/desktop/dd319081%28v=vs.85%29.aspx
Constants
CP_*
Most of these are defined in System (see: \source\rtl\inc\systemh.inc) | |
CP_ACP = 0;
|
Default to ANSI code page |
CP_OEMCP = ?;
|
Default to OEM code page |
CP_MACCP = 2;
|
Default to MAC code page |
CP_THREAD_ACP = 3;
|
Current thread's ANSI code page |
CP_SYMBOL = 42;
|
SYMBOL translations |
CP_UTF16 = 1200;
|
UTF-16 translation |
CP_UNICODE = 1200;
|
Unicode translation |
CP_UTF7 = 65000;
|
UTF-7 translation |
CP_UTF8 = 65001;
|
UTF-8 translation |
CP_OEM_*, CP_ANSI_*
See: https://en.wikipedia.org/wiki/Code_page) | |
CP_OEM_437 = 437;
|
US |
CP_OEM_720 = 720;
|
Arabic |
CP_OEM_737 = 737;
|
Greek |
CP_OEM_775 = 775;
|
Baltic |
CP_OEM_850 = 850;
|
Latin I |
CP_OEM_852 = 852;
|
Latin II |
CP_OEM_857 = 857;
|
Turkish |
CP_OEM_862 = 862;
|
Hebrew |
CP_OEM_866 = 866;
|
Russian |
CP_OEM_874 = 874;
|
Thai |
CP_OEM_1258 = ?258;
|
Vietnam |
CP_ANSI_1250 = ?250;
|
Central Europe |
CP_ANSI_1251 = ?251;
|
Cyrillic |
CP_ANSI_1252 = ?252;
|
Latin I |
CP_ANSI_1253 = ?253;
|
Greek |
CP_ANSI_1254 = ?254;
|
Turkish |
CP_ANSI_1255 = ?255;
|
Hebrew |
CP_ANSI_1256 = ?256;
|
Arabic |
CP_ANSI_1257 = ?257;
|
Baltic |
CP_ANSI_1258 = ?258;
|
Vietnam |
CP_ANSI_874 = 874;
|
Thai |
LOCALE_*
LOCALE_SYSTEM_DEFAULT = $800;
|
|
LOCALE_USER_DEFAULT = $400;
|
MAX_*
MAX_LEADBYTES = 12;
|
5 ranges, 2 bytes each, 0 terminated |
MAX_DEFAULTCHAR = 2;
|
single or double byte |
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
procedure LocaleInit;
Note | None documented |
---|
Locale functions
function IsValidCodePage(CodePage:UINT):BOOL;
Note | None documented |
---|
function GetACP:UINT;
Note | None documented |
---|
function GetOEMCP:UINT;
Note | None documented |
---|
function SetACP(CodePage:UINT):BOOL;
Note | None documented |
---|
function SetOEMCP(CodePage:UINT):BOOL;
Note | None documented |
---|
function GetConsoleCP:UINT;
Note | None documented |
---|
function SetConsoleCP(wCodePageID:UINT):BOOL;
Note | None documented |
---|
function GetConsoleOutputCP:UINT;
Note | None documented |
---|
function SetConsoleOutputCP(wCodePageID:UINT):BOOL;
Note | None documented |
---|
function GetCPInfo(CodePage:UINT; var lpCPInfo:TCPInfo):BOOL;
Note | None documented |
---|
function GetCPInfoEx(CodePage:UINT; dwFlags:DWORD; var lpCPInfoEx:CPINFOEXA):BOOL;
Note | None documented |
---|
function GetCPInfoExA(CodePage:UINT; dwFlags:DWORD; var lpCPInfoEx:CPINFOEXA):BOOL;
Note | None documented |
---|
function GetCPInfoExW(CodePage:UINT; dwFlags:DWORD; var lpCPInfoEx:CPINFOEXW):BOOL;
Note | None documented |
---|
function IsValidLocale(Locale:LCID; dwFlags:DWORD):BOOL;
Note | None documented |
---|
function GetSystemDefaultLCID:LCID;
Note | None documented |
---|
function GetUserDefaultLCID:LCID;
Note | None documented |
---|
function SetSystemDefaultLCID(Locale:LCID):BOOL;
Note | None documented |
---|
RTL unicode string manager functions
function SysGetStandardCodePage(const stdcp:TStandardCodePageEnum):TSystemCodePage;
Note | None documented |
---|
Locale helper functions
function MapPage(CodePage:UINT):Word;
Note | None documented |
---|
function GetPage(PageID:Word):PCodePage;
Note | None documented |
---|
function CheckPage(Page:PCodePage):Boolean;
Note | None documented |
---|
function LinkPage(Page:PCodePage):Boolean;
Note | None documented |
---|
function UnlinkPage(Page:PCodePage):Boolean;
Note | None documented |
---|
function LoadPage(PageID:Word; Table:PCodeTable; Lower:PLowerTable; Upper:PUpperTable):Boolean;
Note | None documented |
---|
function UnloadPage(PageID:Word; Page:PCodePage):Boolean;
Note | None documented |
---|
function DefaultTrans(PageID,TransID:Word):Boolean;
Note | None documented |
---|
function InstallTrans(PageID:Word; Table:PTransTable):Boolean;
Note | None documented |
---|
Return to Unit Reference