NAME
Win32::OLE::NLS - OLE National Language Support
SYNOPSIS
missing
DESCRIPTION
This module provides access to the national language support features in the OLENLS.DLL.
Functions
- CompareString(LCID,FLAGS,STR1,STR2)
-
Compare STR1 and STR2 in the LCID locale. FLAGS indicate the character traits to be used or ignored when comparing the two strings.
NORM_IGNORECASE Ignore case NORM_IGNOREKANATYPE Ignore hiragana/katakana character differences NORM_IGNORENONSPACE Ignore accents, diacritics, and vowel marks NORM_IGNORESYMBOLS Ignore symbols NORM_IGNOREWIDTH Ignore character width
Possible return values are:
0 Function failed 1 STR1 is less than STR2 2 STR1 is equal to STR2 3 STR1 is greater than STR2
Note that you can subtract 2 from the return code to get values comparable to the
cmp
operator. - LCMapString(LCID,FLAGS,STR)
-
LCMapString translates STR using LCID dependent translation. Flags contains a combination of the following options:
LCMAP_LOWERCASE Lowercase LCMAP_UPPERCASE Uppercase LCMAP_HALFWIDTH Narrow characters LCMAP_FULLWIDTH Wide characters LCMAP_HIRAGANA Hiragana LCMAP_KATAKANA Katakana LCMAP_SORTKEY Character sort key
The following normalization options can be combined with
LCMAP_SORTKEY
:NORM_IGNORECASE Ignore case NORM_IGNOREKANATYPE Ignore hiragana/katakana character differences NORM_IGNORENONSPACE Ignore accents, diacritics, and vowel marks NORM_IGNORESYMBOLS Ignore symbols NORM_IGNOREWIDTH Ignore character width
The return value is the translated string.
- GetLocaleInfo(LCID,LCTYPE)
-
Retrieve locale setting LCTYPE from the locale specified by LCID. Use LOCALE_NOUSEROVERRIDE | LCTYPE to always query the locale database. Otherwise user changes to
win.ini
through the windows control panel take precedence when retrieving values for the system default locale. See the documentation below for a list of valid LCTYPE values.The return value is the contents of the requested locale setting.
- GetStringType(LCID,TYPE,STR)
-
Retrieve type information from locale LCID about each character in STR. The requested TYPE can be one of the following 3 levels:
CT_CTYPE1 ANSI C and POSIX type information CT_CTYPE2 Text layout type information CT_CTYPE3 Text processing type information
The return value is a list of values, each of wich is a bitwise OR of the applicable type bits from the corresponding table below:
@ct = GetStringType(LOCALE_SYSTEM_DEFAULT, CT_CTYPE1, "String");
ANSI C and POSIX character type information:
C1_UPPER Uppercase C1_LOWER Lowercase C1_DIGIT Decimal digits C1_SPACE Space characters C1_PUNCT Punctuation C1_CNTRL Control characters C1_BLANK Blank characters C1_XDIGIT Hexadecimal digits C1_ALPHA Any letter
Text layout type information:
C2_LEFTTORIGHT Left to right C2_RIGHTTOLEFT Right to left C2_EUROPENUMBER European number, European digit C2_EUROPESEPARATOR European numeric separator C2_EUROPETERMINATOR European numeric terminator C2_ARABICNUMBER Arabic number C2_COMMONSEPARATOR Common numeric separator C2_BLOCKSEPARATOR Block separator C2_SEGMENTSEPARATOR Segment separator C2_WHITESPACE White space C2_OTHERNEUTRAL Other neutrals C2_NOTAPPLICABLE No implicit direction (e.g. ctrl codes)
Text precessing type information:
C3_NONSPACING Nonspacing mark C3_DIACRITIC Diacritic nonspacing mark C3_VOWELMARK Vowel nonspacing mark C3_SYMBOL Symbol C3_KATAKANA Katakana character C3_HIRAGANA Hiragana character C3_HALFWIDTH Narrow character C3_FULLWIDTH Wide character C3_IDEOGRAPH Ideograph C3_ALPHA Any letter C3_NOTAPPLICABLE Not applicable
- GetSystemDefaultLangID()
-
Returns the system default language identifier.
- GetSystemDefaultLCID()
-
Returns the system default locale identifier.
- GetUserDefaultLangID()
-
Returns the user default language identifier.
- GetUserDefaultLCID()
-
Returns the user default locale identifier.
- SendSettingChange()
-
Sends a WM_SETTINGCHANGE message to all top level windows.
- SetLocaleInfo(LCID, LCTYPE, LCDATA)
-
Changes an item in the user override part of the locale setting LCID. It doesn't change the system default database. The following LCTYPEs are changeable:
LOCALE_ICALENDARTYPE LOCALE_SDATE LOCALE_ICURRDIGITS LOCALE_SDECIMAL LOCALE_ICURRENCY LOCALE_SGROUPING LOCALE_IDIGITS LOCALE_SLIST LOCALE_IFIRSTDAYOFWEEK LOCALE_SLONGDATE LOCALE_IFIRSTWEEKOFYEAR LOCALE_SMONDECIMALSEP LOCALE_ILZERO LOCALE_SMONGROUPING LOCALE_IMEASURE LOCALE_SMONTHOUSANDSEP LOCALE_INEGCURR LOCALE_SNEGATIVESIGN LOCALE_INEGNUMBER LOCALE_SPOSITIVESIGN LOCALE_IPAPERSIZE LOCALE_SSHORTDATE LOCALE_ITIME LOCALE_STHOUSAND LOCALE_S1159 LOCALE_STIME LOCALE_S2359 LOCALE_STIMEFORMAT LOCALE_SCURRENCY LOCALE_SYEARMONTH
You have to call SendSettingChange() to activate these changes for subsequent Win32::OLE::Variant object formatting because the OLE subsystem seems to cache locale information.
- MAKELANGID(LANG,SUBLANG)
-
Creates a lnguage identifier from a primary language and a sublanguage.
- PRIMARYLANGID(LANGID)
-
Retrieves the primary language from a language identifier.
- SUBLANGID(LANGID)
-
Retrieves the sublanguage from a language identifier.
- MAKELCID(LANGID)
-
Creates a locale identifies from a language identifier.
- LANGIDFROMLCID(LCID)
-
Retrieves a language identifier from a locale identifier.
Locale Types
- LOCALE_ILANGUAGE
-
The language identifier (in hex).
- LOCALE_SLANGUAGE
-
The localized name of the language.
- LOCALE_SENGLANGUAGE
-
The ISO Standard 639 English name of the language.
- LOCALE_SABBREVLANGNAME
-
The three-letter abbreviated name of the language. The first two letters are from the ISO Standard 639 language name abbreviation. The third letter indicates the sublanguage type.
- LOCALE_SNATIVELANGNAME
-
The native name of the language.
- LOCALE_ICOUNTRY
-
The country code, which is based on international phone codes.
- LOCALE_SCOUNTRY
-
The localized name of the country.
- LOCALE_SENGCOUNTRY
-
The English name of the country.
- LOCALE_SABBREVCTRYNAME
-
The ISO Standard 3166 abbreviated name of the country.
- LOCALE_SNATIVECTRYNAME
-
The native name of the country.
- LOCALE_IDEFAULTLANGUAGE
-
Language identifier for the principal language spoken in this locale.
- LOCALE_IDEFAULTCOUNTRY
-
Country code for the principal country in this locale.
- LOCALE_IDEFAULTANSICODEPAGE
-
The ANSI code page associated with this locale. Format: 4 Unicode decimal digits plus a Unicode null terminator.
XXX This should be translated by GetLocaleInfo. XXX
- LOCALE_IDEFAULTCODEPAGE
-
The OEM code page associated with the country.
- LOCALE_SLIST
-
Characters used to separate list items (often a comma).
- LOCALE_IMEASURE
-
Default measurement system:
0 metric system (S.I.) 1 U.S. system
- LOCALE_SDECIMAL
-
Characters used for the decimal separator (often a dot).
- LOCALE_STHOUSAND
-
Characters used as the separator between groups of digits left of the decimal.
- LOCALE_SGROUPING
-
Sizes for each group of digits to the left of the decimal. An explicit size is required for each group. Sizes are separated by semicolons. If the last value is 0, the preceding value is repeated. To group thousands, specify 3;0.
- LOCALE_IDIGITS
-
The number of fractional digits.
- LOCALE_ILZERO
-
Whether to use leading zeros in decimal fields. A setting of 0 means use no leading zeros; 1 means use leading zeros.
- LOCALE_SNATIVEDIGITS
-
The ten characters that are the native equivalent of the ASCII 0-9.
- LOCALE_INEGNUMBER
-
Negative number mode.
0 (1.1) 1 -1.1 2 -1.1 3 1.1 4 1.1
- LOCALE_SCURRENCY
-
The string used as the local monetary symbol.
- LOCALE_SINTLSYMBOL
-
Three characters of the International monetary symbol specified in ISO 4217, Codes for the Representation of Currencies and Funds, followed by the character separating this string from the amount.
- LOCALE_SMONDECIMALSEP
-
Characters used for the monetary decimal separators.
- LOCALE_SMONTHOUSANDSEP
-
Characters used as monetary separator between groups of digits left of the decimal.
- LOCALE_SMONGROUPING
-
Sizes for each group of monetary digits to the left of the decimal. An explicit size is needed for each group. Sizes are separated by semicolons. If the last value is 0, the preceding value is repeated. To group thousands, specify 3;0.
- LOCALE_ICURRDIGITS
-
Number of fractional digits for the local monetary format.
- LOCALE_IINTLCURRDIGITS
-
Number of fractional digits for the international monetary format.
- LOCALE_ICURRENCY
-
Positive currency mode.
0 Prefix, no separation. 1 Suffix, no separation. 2 Prefix, 1-character separation. 3 Suffix, 1-character separation.
- LOCALE_INEGCURR
-
Negative currency mode.
0 ($1.1) 1 -$1.1 2 $-1.1 3 $1.1- 4 $(1.1$) 5 -1.1$ 6 1.1-$ 7 1.1$- 8 -1.1 $ (space before $) 9 -$ 1.1 (space after $) 10 1.1 $- (space before $)
- LOCALE_ICALENDARTYPE
-
The type of calendar currently in use.
1 Gregorian (as in U.S.) 2 Gregorian (always English strings) 3 Era: Year of the Emperor (Japan) 4 Era: Year of the Republic of China 5 Tangun Era (Korea)
- LOCALE_IOPTIONALCALENDAR
-
The additional calendar types available for this LCID. Can be a null-separated list of all valid optional calendars. Value is 0 for "None available" or any of the LOCALE_ICALENDARTYPE settings.
XXX null separated list should be translated by GetLocaleInfo XXX
- LOCALE_SDATE
-
Characters used for the date separator.
- LOCALE_STIME
-
Characters used for the time separator.
- LOCALE_STIMEFORMAT
-
Time-formatting string.
- LOCALE_SSHORTDATE
-
Short Date_Time formatting strings for this locale.
- LOCALE_SLONGDATE
-
Long Date_Time formatting strings for this locale.
- LOCALE_IDATE
-
Short Date format-ordering specifier.
0 Month - Day - Year 1 Day - Month - Year 2 Year - Month - Day
- LOCALE_ILDATE
-
Long Date format ordering specifier. Value can be any of the valid LOCALE_IDATE settings.
- LOCALE_ITIME
-
Time format specifier.
0 AM/PM 12-hour format. 1 24-hour format.
- LOCALE_ITIMEMARKPOSN
-
Whether the time marker string (AM|PM) precedes or follows the time string. 0 Suffix (9:15 AM). 1 Prefix (AM 9:15).
- LOCALE_ICENTURY
-
Whether to use full 4-digit century.
0 Two digit. 1 Full century.
- LOCALE_ITLZERO
-
Whether to use leading zeros in time fields.
0 No leading zeros. 1 Leading zeros for hours.
- LOCALE_IDAYLZERO
-
Whether to use leading zeros in day fields. Values as for LOCALE_ITLZERO.
- LOCALE_IMONLZERO
-
Whether to use leading zeros in month fields. Values as for LOCALE_ITLZERO.
- LOCALE_S1159
-
String for the AM designator.
- LOCALE_S2359
-
String for the PM designator.
- LOCALE_IFIRSTWEEKOFYEAR
-
Specifies which week of the year is considered first.
0 Week containing 1/1 is the first week of the year. 1 First full week following 1/1is the first week of the year. 2 First week with at least 4 days is the first week of the year.
- LOCALE_IFIRSTDAYOFWEEK
-
Specifies the day considered first in the week. Value "0" means SDAYNAME1 and value "6" means SDAYNAME7.
- LOCALE_SDAYNAME1 .. LOCALE_SDAYNAME7
-
Long name for Monday .. Sunday.
- LOCALE_SABBREVDAYNAME1 .. LOCALE_SABBREVDAYNAME7
-
Abbreviated name for Monday .. Sunday.
- LOCALE_SMONTHNAME1 .. LOCALE_SMONTHNAME12
-
Long name for January .. December.
- LOCALE_SMONTHNAME13
-
Native name for 13th month, if it exists.
- LOCALE_SABBREVMONTHNAME1 .. LOCALE_SABBREVMONTHNAME12
-
Abbreviated name for January .. December.
- LOCALE_SABBREVMONTHNAME13
-
Native abbreviated name for 13th month, if it exists.
- LOCALE_SPOSITIVESIGN
-
String value for the positive sign.
- LOCALE_SNEGATIVESIGN
-
String value for the negative sign.
- LOCALE_IPOSSIGNPOSN
-
Formatting index for positive values.
0 Parentheses surround the amount and the monetary symbol. 1 The sign string precedes the amount and the monetary symbol. 2 The sign string precedes the amount and the monetary symbol. 3 The sign string precedes the amount and the monetary symbol. 4 The sign string precedes the amount and the monetary symbol.
- LOCALE_INEGSIGNPOSN
-
Formatting index for negative values. Values as for LOCALE_IPOSSIGNPOSN.
- LOCALE_IPOSSYMPRECEDES
-
If the monetary symbol precedes, 1. If it succeeds a positive amount, 0.
- LOCALE_IPOSSEPBYSPACE
-
If the monetary symbol is separated by a space from a positive amount, 1. Otherwise, 0.
- LOCALE_INEGSYMPRECEDES
-
If the monetary symbol precedes, 1. If it succeeds a negative amount, 0.
- LOCALE_INEGSEPBYSPACE
-
If the monetary symbol is separated by a space from a negative amount, 1. Otherwise, 0.
AUTHORS/COPYRIGHT
This module is part of the Win32::OLE distribution.