Difference between revisions of "Unit Locale"

From Ultibo.org
Jump to: navigation, search
Line 450: Line 450:
 
| <code>MAP_EXPAND_LIGATURES = $00002000;</code>
 
| <code>MAP_EXPAND_LIGATURES = $00002000;</code>
 
| expand all ligatures
 
| expand all ligatures
 +
|-
 +
|}
 +
</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;">'''Locale dependent mapping flag constants''' <code> LCMAP_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>LCMAP_LOWERCASE = $00000100;</code>
 +
| lower case letters
 +
|-
 +
| <code>LCMAP_UPPERCASE = $00000200;</code>
 +
| upper case letters
 +
|-
 +
| <code>LCMAP_SORTKEY = $00000400;</code>
 +
| WC sort key (normalize)
 +
|-
 +
| <code>LCMAP_BYTEREV = $00000800;</code>
 +
| byte reversal
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>LCMAP_HIRAGANA = $00100000;</code>
 +
| map katakana to hiragana
 +
|-
 +
| <code>LCMAP_KATAKANA = $00200000;</code>
 +
| map hiragana to katakana
 +
|-
 +
| <code>LCMAP_HALFWIDTH = $00400000;</code>
 +
| map double byte to single byte
 +
|-
 +
| <code>LCMAP_FULLWIDTH = $00800000;</code>
 +
| map single byte to double byte
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>LCMAP_LINGUISTIC_CASING = $01000000;</code>
 +
| use linguistic rules for casing
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>LCMAP_SIMPLIFIED_CHINESE  = $02000000;</code>
 +
| map traditional chinese to simplified chinese
 +
|-
 +
| <code>LCMAP_TRADITIONAL_CHINESE = $04000000;</code>
 +
| map simplified chinese to traditional chinese
 +
|-
 +
|}
 +
</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;">'''Language group enumeration flag constants''' <code> LGRPID_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>LGRPID_INSTALLED = $00000001;</code>
 +
| installed language group ids
 +
|-
 +
| <code>LGRPID_SUPPORTED = $00000002;</code>
 +
| supported language group ids
 +
|-
 +
|}
 +
</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;">'''Locale enumeration flag constants''' <code> LCID_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>LCID_INSTALLED = $00000001;</code>
 +
| installed locale ids
 +
|-
 +
| <code>LCID_SUPPORTED = $00000002;</code>
 +
| supported locale ids
 +
|-
 +
| <code>LCID_ALTERNATE_SORTS = $00000004;</code>
 +
| alternate sort locale ids
 +
|-
 +
|}
 +
</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;">'''Code page enumeration flag constants''' <code> CP_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>CP_INSTALLED = $00000001;</code>
 +
| installed code page ids
 +
|-
 +
| <code>CP_SUPPORTED = $00000002;</code>
 +
| supported code page ids
 +
|-
 +
|}
 +
</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;">'''Sorting flag constants''' <code> SORT_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SORT_STRINGSORT = $00001000;</code>
 +
| use string sort method
 +
|-
 +
|}
 +
</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;">'''Compare string return value constants''' <code> CSTR_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>CSTR_LESS_THAN = 1;</code>
 +
| string 1 less than string 2
 +
|-
 +
| <code>CSTR_EQUAL = 2;</code>
 +
| string 1 equal to string 2
 +
|-
 +
| <code>CSTR_GREATER_THAN = 3;</code>
 +
| string 1 greater than string 2
 +
|-
 +
|}
 +
</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;">'''Country/Region code constants''' <code> CTRY_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>CTRY_DEFAULT = 0;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>CTRY_ALBANIA = 355;</code>
 +
| Albania
 +
|-
 +
| <code>CTRY_ALGERIA = 213;</code>
 +
| Algeria
 +
|-
 +
| <code>CTRY_ARGENTINA = 54;</code>
 +
| Argentina
 +
|-
 +
| <code>CTRY_ARMENIA = 374;</code>
 +
| Armenia
 +
|-
 +
| <code>CTRY_AUSTRALIA = 61;</code>
 +
| Australia
 +
|-
 +
| <code>CTRY_AUSTRIA = 43;</code>
 +
| Austria
 +
|-
 +
| <code>CTRY_AZERBAIJAN = 994;</code>
 +
| Azerbaijan
 +
|-
 +
| <code>CTRY_BAHRAIN = 973;</code>
 +
| Bahrain
 +
|-
 +
| <code>CTRY_BELARUS = 375;</code>
 +
| Belarus
 +
|-
 +
| <code>CTRY_BELGIUM = 32;</code>
 +
| Belgium
 +
|-
 +
| <code>CTRY_BELIZE = 501;</code>
 +
| Belize
 +
|-
 +
| <code>CTRY_BOLIVIA = 591;</code>
 +
| Bolivia
 +
|-
 +
| <code>CTRY_BRAZIL = 55;</code>
 +
| Brazil
 +
|-
 +
| <code>CTRY_BRUNEI_DARUSSALAM = 673;</code>
 +
| Brunei Darussalam
 +
|-
 +
| <code>CTRY_BULGARIA = 359;</code>
 +
| Bulgaria
 +
|-
 +
| <code>CTRY_CANADA = 2;</code>
 +
| Canada
 +
|-
 +
| <code>CTRY_CARIBBEAN = 1;</code>
 +
| Caribbean
 +
|-
 +
| <code>CTRY_CHILE = 56;</code>
 +
| Chile
 +
|-
 +
| <code>CTRY_COLOMBIA = 57;</code>
 +
| Colombia
 +
|-
 +
| <code>CTRY_COSTA_RICA = 506;</code>
 +
| Costa Rica
 +
|-
 +
| <code>CTRY_CROATIA = 385;</code>
 +
| Croatia
 +
|-
 +
| <code>CTRY_CZECH = 420;</code>
 +
| Czech Republic
 +
|-
 +
| <code>CTRY_DENMARK = 45;</code>
 +
| Denmark
 +
|-
 +
| <code>CTRY_DOMINICAN_REPUBLIC = 1;</code>
 +
| Dominican Republic
 +
|-
 +
| <code>CTRY_ECUADOR = 593;</code>
 +
| Ecuador
 +
|-
 +
| <code>CTRY_EGYPT = 20;</code>
 +
| Egypt
 +
|-
 +
| <code>CTRY_EL_SALVADOR = 503;</code>
 +
| El Salvador
 +
|-
 +
| <code>CTRY_ESTONIA = 372;</code>
 +
| Estonia
 +
|-
 +
| <code>CTRY_FAEROE_ISLANDS = 298;</code>
 +
| Faeroe Islands
 +
|-
 +
| <code>CTRY_FINLAND = 358;</code>
 +
| Finland
 +
|-
 +
| <code>CTRY_FRANCE = 33;</code>
 +
| France
 +
|-
 +
| <code>CTRY_GEORGIA = 995;</code>
 +
| Georgia
 +
|-
 +
| <code>CTRY_GERMANY = 49;</code>
 +
| Germany
 +
|-
 +
| <code>CTRY_GREECE = 30;</code>
 +
| Greece
 +
|-
 +
| <code>CTRY_GUATEMALA = 502;</code>
 +
| Guatemala
 +
|-
 +
| <code>CTRY_HONDURAS = 504;</code>
 +
| Honduras
 +
|-
 +
| <code>CTRY_HONG_KONG = 852;</code>
 +
| Hong Kong S.A.R., P.R.C.
 +
|-
 +
| <code>CTRY_HUNGARY = 36;</code>
 +
| Hungary
 +
|-
 +
| <code>CTRY_ICELAND = 354;</code>
 +
| Iceland
 +
|-
 +
| <code>CTRY_INDIA = 91;</code>
 +
| India
 +
|-
 +
| <code>CTRY_INDONESIA = 62;</code>
 +
| Indonesia
 +
|-
 +
| <code>CTRY_IRAN = 981;</code>
 +
| Iran
 +
|-
 +
| <code>CTRY_IRAQ = 964;</code>
 +
| Iraq
 +
|-
 +
| <code>CTRY_IRELAND = 353;</code>
 +
| Ireland
 +
|-
 +
| <code>CTRY_ISRAEL = 972;</code>
 +
| Israel
 +
|-
 +
| <code>CTRY_ITALY = 39;</code>
 +
| Italy
 +
|-
 +
| <code>CTRY_JAMAICA = 1;</code>
 +
| Jamaica
 +
|-
 +
| <code>CTRY_JAPAN = 81;</code>
 +
| Japan
 +
|-
 +
| <code>CTRY_JORDAN = 962;</code>
 +
| Jordan
 +
|-
 +
| <code>CTRY_KAZAKSTAN = 7;</code>
 +
| Kazakstan
 +
|-
 +
| <code>CTRY_KENYA = 254;</code>
 +
| Kenya
 +
|-
 +
| <code>CTRY_KUWAIT = 965;</code>
 +
| Kuwait
 +
|-
 +
| <code>CTRY_KYRGYZSTAN = 996;</code>
 +
| Kyrgyzstan
 +
|-
 +
| <code>CTRY_LATVIA = 371;</code>
 +
| Latvia
 +
|-
 +
| <code>CTRY_LEBANON = 961;</code>
 +
| Lebanon
 +
|-
 +
| <code>CTRY_LIBYA = 218;</code>
 +
| Libya
 +
|-
 +
| <code>CTRY_LIECHTENSTEIN = 41;</code>
 +
| Liechtenstein
 +
|-
 +
| <code>CTRY_LITHUANIA = 370;</code>
 +
| Lithuania
 +
|-
 +
| <code>CTRY_LUXEMBOURG = 352;</code>
 +
| Luxembourg
 +
|-
 +
| <code>CTRY_MACAU = 853;</code>
 +
| Macau S.A.R., PRC
 +
|-
 +
| <code>CTRY_MACEDONIA = 389;</code>
 +
| Former Yugoslav Republic of Macedonia
 +
|-
 +
| <code>CTRY_MALAYSIA = 60;</code>
 +
| Malaysia
 +
|-
 +
| <code>CTRY_MALDIVES = 960;</code>
 +
| Maldives
 +
|-
 +
| <code>CTRY_MEXICO = 52;</code>
 +
| Mexico
 +
|-
 +
| <code>CTRY_MONACO = 33;</code>
 +
| Principality of Monaco
 +
|-
 +
| <code>CTRY_MONGOLIA = 976;</code>
 +
| Mongolia
 +
|-
 +
| <code>CTRY_MOROCCO = 212;</code>
 +
| Morocco
 +
|-
 +
| <code>CTRY_NETHERLANDS = 31;</code>
 +
| Netherlands
 +
|-
 +
| <code>CTRY_NEW_ZEALAND = 64;</code>
 +
| New Zealand
 +
|-
 +
| <code>CTRY_NICARAGUA = 505;</code>
 +
| Nicaragua
 +
|-
 +
| <code>CTRY_NORWAY = 47;</code>
 +
| Norway
 +
|-
 +
| <code>CTRY_OMAN = 968;</code>
 +
| Oman
 +
|-
 +
| <code>CTRY_PAKISTAN = 92;</code>
 +
| Islamic Republic of Pakistan
 +
|-
 +
| <code>CTRY_PANAMA = 507;</code>
 +
| Panama
 +
|-
 +
| <code>CTRY_PARAGUAY = 595;</code>
 +
| Paraguay
 +
|-
 +
| <code>CTRY_PERU = 51;</code>
 +
| Peru
 +
|-
 +
| <code>CTRY_PHILIPPINES = 63;</code>
 +
| Republic of the Philippines
 +
|-
 +
| <code>CTRY_POLAND = 48;</code>
 +
| Poland
 +
|-
 +
| <code>CTRY_PORTUGAL = 351;</code>
 +
| Portugal
 +
|-
 +
| <code>CTRY_PRCHINA = 86;</code>
 +
| People's Republic of China
 +
|-
 +
| <code>CTRY_PUERTO_RICO = 1;</code>
 +
| Puerto Rico
 +
|-
 +
| <code>CTRY_QATAR = 974;</code>
 +
| Qatar
 +
|-
 +
| <code>CTRY_ROMANIA = 40;</code>
 +
| Romania
 +
|-
 +
| <code>CTRY_RUSSIA = 7;</code>
 +
| Russia
 +
|-
 +
| <code>CTRY_SAUDI_ARABIA = 966;</code>
 +
| Saudi Arabia
 +
|-
 +
| <code>CTRY_SERBIA = 381;</code>
 +
| Serbia
 +
|-
 +
| <code>CTRY_SINGAPORE = 65;</code>
 +
| Singapore
 +
|-
 +
| <code>CTRY_SLOVAK = 421;</code>
 +
| Slovak Republic
 +
|-
 +
| <code>CTRY_SLOVENIA = 386;</code>
 +
| Slovenia
 +
|-
 +
| <code>CTRY_SOUTH_AFRICA = 27;</code>
 +
| South Africa
 +
|-
 +
| <code>CTRY_SOUTH_KOREA = 82;</code>
 +
| Korea
 +
|-
 +
| <code>CTRY_SPAIN = 34;</code>
 +
| Spain
 +
|-
 +
| <code>CTRY_SWEDEN = 46;</code>
 +
| Sweden
 +
|-
 +
| <code>CTRY_SWITZERLAND = 41;</code>
 +
| Switzerland
 +
|-
 +
| <code>CTRY_SYRIA = 963;</code>
 +
| Syria
 +
|-
 +
| <code>CTRY_TAIWAN = 886;</code>
 +
| Taiwan
 +
|-
 +
| <code>CTRY_TATARSTAN = 7;</code>
 +
| Tatarstan
 +
|-
 +
| <code>CTRY_THAILAND = 66;</code>
 +
| Thailand
 +
|-
 +
| <code>CTRY_TRINIDAD_Y_TOBAGO = 1;</code>
 +
| Trinidad y Tobago
 +
|-
 +
| <code>CTRY_TUNISIA = 216;</code>
 +
| Tunisia
 +
|-
 +
| <code>CTRY_TURKEY = 90;</code>
 +
| Turkey
 +
|-
 +
| <code>CTRY_UAE = 971;</code>
 +
| U.A.E.
 +
|-
 +
| <code>CTRY_UKRAINE = 380;</code>
 +
| Ukraine
 +
|-
 +
| <code>CTRY_UNITED_KINGDOM = 44;</code>
 +
| United Kingdom
 +
|-
 +
| <code>CTRY_UNITED_STATES = 1;</code>
 +
| United States
 +
|-
 +
| <code>CTRY_URUGUAY = 598;</code>
 +
| Uruguay
 +
|-
 +
| <code>CTRY_UZBEKISTAN = 7;</code>
 +
| Uzbekistan
 +
|-
 +
| <code>CTRY_VENEZUELA = 58;</code>
 +
| Venezuela
 +
|-
 +
| <code>CTRY_VIET_NAM = 84;</code>
 +
| Viet Nam
 +
|-
 +
| <code>CTRY_YEMEN = 967;</code>
 +
| Yemen
 +
|-
 +
| <code>CTRY_ZIMBABWE = 263;</code>
 +
| Zimbabwe
 
|-
 
|-
 
|}
 
|}

Revision as of 03:43, 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



[Expand]
Default code page constants CP_*


[Expand]
Code page identifier constants CP_OEM_*, CP_ANSI_*


[Expand]
Default locale constants LOCALE_*


[Expand]
String length maximum constants MAX_*


[Expand]
MBCS and Unicode translation flag constants MB_*, WC_*


[Expand]
Character type flag constants CT_*


[Expand]
CType 1 flag bit constants C1_*


[Expand]
CType 2 flag bit constants C2_*


[Expand]
CType 3 flag bit constants C3_*


[Expand]
String flag constants NORM_*


[Expand]
Locale independent mapping flag constants MAP_*


[Expand]
Locale dependent mapping flag constants LCMAP_*


[Expand]
Language group enumeration flag constants LGRPID_*


[Expand]
Locale enumeration flag constants LCID_*


[Expand]
Code page enumeration flag constants CP_*


[Expand]
Sorting flag constants SORT_*


[Expand]
Compare string return value constants CSTR_*


[Expand]
Country/Region code constants CTRY_*


Type definitions


To be documented

Public variables


To be documented

Function declarations



Initialization functions

[Expand]
procedure LocaleInit;
Description: To be documented


Locale functions

[Expand]
function IsValidCodePage(CodePage:UINT):BOOL;
Description: To be documented


[Expand]
function GetACP:UINT;
Description: To be documented


[Expand]
function GetOEMCP:UINT;
Description: To be documented


[Expand]
function SetACP(CodePage:UINT):BOOL;
Description: To be documented


[Expand]
function SetOEMCP(CodePage:UINT):BOOL;
Description: To be documented


[Expand]
function GetConsoleCP:UINT;
Description: To be documented


[Expand]
function SetConsoleCP(wCodePageID:UINT):BOOL;
Description: To be documented


[Expand]
function GetConsoleOutputCP:UINT;
Description: To be documented


[Expand]
function SetConsoleOutputCP(wCodePageID:UINT):BOOL;
Description: To be documented


[Expand]
function GetCPInfo(CodePage:UINT; var lpCPInfo:TCPInfo):BOOL;
Description: To be documented


[Expand]
function GetCPInfoEx(CodePage:UINT; dwFlags:DWORD; var lpCPInfoEx:CPINFOEXA):BOOL;
Description: To be documented


[Expand]
function GetCPInfoExA(CodePage:UINT; dwFlags:DWORD; var lpCPInfoEx:CPINFOEXA):BOOL;
Description: To be documented


[Expand]
function GetCPInfoExW(CodePage:UINT; dwFlags:DWORD; var lpCPInfoEx:CPINFOEXW):BOOL;
Description: To be documented


[Expand]
function IsValidLocale(Locale:LCID; dwFlags:DWORD):BOOL;
Description: To be documented


[Expand]
function GetSystemDefaultLCID:LCID;
Description: To be documented


[Expand]
function GetUserDefaultLCID:LCID;
Description: To be documented


[Expand]
function SetSystemDefaultLCID(Locale:LCID):BOOL;
Description: To be documented


RTL unicode string manager functions

[Expand]
function SysGetStandardCodePage(const stdcp:TStandardCodePageEnum):TSystemCodePage;
Description: To be documented


Locale helper functions

[Expand]
function MapPage(CodePage:UINT):Word;
Description: Map a default code page to the actual current page


[Expand]
function GetPage(PageID:Word):PCodePage;
Description: Find the requested page in the linked list


[Expand]
function CheckPage(Page:PCodePage):Boolean;
Description: Check that the Page supplied is part of the Linked list


[Expand]
function LinkPage(Page:PCodePage):Boolean;
Description: Link Page to Prev,Next Siblings and Adjust First/Last


[Expand]
function UnlinkPage(Page:PCodePage):Boolean;
Description: Unlink Page from Prev,Next Siblings and Adjust First/Last


[Expand]
function LoadPage(PageID:Word; Table:PCodeTable; Lower:PLowerTable; Upper:PUpperTable):Boolean;
Description: Load a code table and allocate memory to create a code page


[Expand]
function UnloadPage(PageID:Word; Page:PCodePage):Boolean;
Description: Unload a code page and release allocated memory


[Expand]
function DefaultTrans(PageID,TransID:Word):Boolean;
Description: To be documented


[Expand]
function InstallTrans(PageID:Word; Table:PTransTable):Boolean;
Description: To be documented


Return to Unit Reference