Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

968 lines
31 KiB

  1. # The documentation is at the __END__
  2. package Win32::OLE::NLS;
  3. require Win32::OLE; # Make sure the XS bootstrap has been called
  4. use strict;
  5. use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS @ISA);
  6. use Exporter;
  7. @ISA = qw(Exporter);
  8. @EXPORT = qw(
  9. CompareString
  10. LCMapString
  11. GetLocaleInfo
  12. GetStringType
  13. GetSystemDefaultLangID
  14. GetSystemDefaultLCID
  15. GetUserDefaultLangID
  16. GetUserDefaultLCID
  17. MAKELANGID
  18. PRIMARYLANGID
  19. SUBLANGID
  20. LANG_SYSTEM_DEFAULT
  21. LANG_USER_DEFAULT
  22. MAKELCID
  23. LANGIDFROMLCID
  24. LOCALE_SYSTEM_DEFAULT
  25. LOCALE_USER_DEFAULT
  26. );
  27. @EXPORT_OK = qw(SetLocaleInfo SendSettingChange);
  28. %EXPORT_TAGS =
  29. (
  30. CT => [qw(CT_CTYPE1 CT_CTYPE2 CT_CTYPE3)],
  31. C1 => [qw(C1_UPPER C1_LOWER C1_DIGIT C1_SPACE C1_PUNCT
  32. C1_CNTRL C1_BLANK C1_XDIGIT C1_ALPHA)],
  33. C2 => [qw(C2_LEFTTORIGHT C2_RIGHTTOLEFT C2_EUROPENUMBER
  34. C2_EUROPESEPARATOR C2_EUROPETERMINATOR C2_ARABICNUMBER
  35. C2_COMMONSEPARATOR C2_BLOCKSEPARATOR C2_SEGMENTSEPARATOR
  36. C2_WHITESPACE C2_OTHERNEUTRAL C2_NOTAPPLICABLE)],
  37. C3 => [qw(C3_NONSPACING C3_DIACRITIC C3_VOWELMARK C3_SYMBOL C3_KATAKANA
  38. C3_HIRAGANA C3_HALFWIDTH C3_FULLWIDTH C3_IDEOGRAPH C3_KASHIDA
  39. C3_ALPHA C3_NOTAPPLICABLE)],
  40. NORM => [qw(NORM_IGNORECASE NORM_IGNORENONSPACE NORM_IGNORESYMBOLS
  41. NORM_IGNOREWIDTH NORM_IGNOREKANATYPE NORM_IGNOREKASHIDA)],
  42. LCMAP => [qw(LCMAP_LOWERCASE LCMAP_UPPERCASE LCMAP_SORTKEY LCMAP_HALFWIDTH
  43. LCMAP_FULLWIDTH LCMAP_HIRAGANA LCMAP_KATAKANA)],
  44. LANG => [qw(LANG_NEUTRAL LANG_ALBANIAN LANG_ARABIC LANG_BAHASA
  45. LANG_BULGARIAN LANG_CATALAN LANG_CHINESE LANG_CZECH LANG_DANISH
  46. LANG_DUTCH LANG_ENGLISH LANG_FINNISH LANG_FRENCH LANG_GERMAN
  47. LANG_GREEK LANG_HEBREW LANG_HUNGARIAN LANG_ICELANDIC
  48. LANG_ITALIAN LANG_JAPANESE LANG_KOREAN LANG_NORWEGIAN
  49. LANG_POLISH LANG_PORTUGUESE LANG_RHAETO_ROMAN LANG_ROMANIAN
  50. LANG_RUSSIAN LANG_SERBO_CROATIAN LANG_SLOVAK LANG_SPANISH
  51. LANG_SWEDISH LANG_THAI LANG_TURKISH LANG_URDU)],
  52. SUBLANG => [qw(SUBLANG_NEUTRAL SUBLANG_DEFAULT SUBLANG_SYS_DEFAULT
  53. SUBLANG_CHINESE_SIMPLIFIED SUBLANG_CHINESE_TRADITIONAL
  54. SUBLANG_DUTCH SUBLANG_DUTCH_BELGIAN SUBLANG_ENGLISH_US
  55. SUBLANG_ENGLISH_UK SUBLANG_ENGLISH_AUS SUBLANG_ENGLISH_CAN
  56. SUBLANG_ENGLISH_NZ SUBLANG_ENGLISH_EIRE SUBLANG_FRENCH
  57. SUBLANG_FRENCH_BELGIAN SUBLANG_FRENCH_CANADIAN
  58. SUBLANG_FRENCH_SWISS SUBLANG_GERMAN SUBLANG_GERMAN_SWISS
  59. SUBLANG_GERMAN_AUSTRIAN SUBLANG_ITALIAN SUBLANG_ITALIAN_SWISS
  60. SUBLANG_NORWEGIAN_BOKMAL SUBLANG_NORWEGIAN_NYNORSK
  61. SUBLANG_PORTUGUESE SUBLANG_PORTUGUESE_BRAZILIAN
  62. SUBLANG_SERBO_CROATIAN_CYRILLIC SUBLANG_SERBO_CROATIAN_LATIN
  63. SUBLANG_SPANISH SUBLANG_SPANISH_MEXICAN
  64. SUBLANG_SPANISH_MODERN)],
  65. CTRY => [qw(CTRY_DEFAULT CTRY_AUSTRALIA CTRY_AUSTRIA CTRY_BELGIUM
  66. CTRY_BRAZIL CTRY_CANADA CTRY_DENMARK CTRY_FINLAND CTRY_FRANCE
  67. CTRY_GERMANY CTRY_ICELAND CTRY_IRELAND CTRY_ITALY CTRY_JAPAN
  68. CTRY_MEXICO CTRY_NETHERLANDS CTRY_NEW_ZEALAND CTRY_NORWAY
  69. CTRY_PORTUGAL CTRY_PRCHINA CTRY_SOUTH_KOREA CTRY_SPAIN
  70. CTRY_SWEDEN CTRY_SWITZERLAND CTRY_TAIWAN CTRY_UNITED_KINGDOM
  71. CTRY_UNITED_STATES)],
  72. LOCALE => [qw(LOCALE_NOUSEROVERRIDE LOCALE_ILANGUAGE LOCALE_SLANGUAGE
  73. LOCALE_SENGLANGUAGE LOCALE_SABBREVLANGNAME
  74. LOCALE_SNATIVELANGNAME LOCALE_ICOUNTRY LOCALE_SCOUNTRY
  75. LOCALE_SENGCOUNTRY LOCALE_SABBREVCTRYNAME LOCALE_SNATIVECTRYNAME
  76. LOCALE_IDEFAULTLANGUAGE LOCALE_IDEFAULTCOUNTRY
  77. LOCALE_IDEFAULTCODEPAGE LOCALE_IDEFAULTANSICODEPAGE LOCALE_SLIST
  78. LOCALE_IMEASURE LOCALE_SDECIMAL LOCALE_STHOUSAND
  79. LOCALE_SGROUPING LOCALE_IDIGITS LOCALE_ILZERO LOCALE_INEGNUMBER
  80. LOCALE_SNATIVEDIGITS LOCALE_SCURRENCY LOCALE_SINTLSYMBOL
  81. LOCALE_SMONDECIMALSEP LOCALE_SMONTHOUSANDSEP LOCALE_SMONGROUPING
  82. LOCALE_ICURRDIGITS LOCALE_IINTLCURRDIGITS LOCALE_ICURRENCY
  83. LOCALE_INEGCURR LOCALE_SDATE LOCALE_STIME LOCALE_SSHORTDATE
  84. LOCALE_SLONGDATE LOCALE_STIMEFORMAT LOCALE_IDATE LOCALE_ILDATE
  85. LOCALE_ITIME LOCALE_ITIMEMARKPOSN LOCALE_ICENTURY LOCALE_ITLZERO
  86. LOCALE_IDAYLZERO LOCALE_IMONLZERO LOCALE_S1159 LOCALE_S2359
  87. LOCALE_ICALENDARTYPE LOCALE_IOPTIONALCALENDAR
  88. LOCALE_IFIRSTDAYOFWEEK LOCALE_IFIRSTWEEKOFYEAR LOCALE_SDAYNAME1
  89. LOCALE_SDAYNAME2 LOCALE_SDAYNAME3 LOCALE_SDAYNAME4
  90. LOCALE_SDAYNAME5 LOCALE_SDAYNAME6 LOCALE_SDAYNAME7
  91. LOCALE_SABBREVDAYNAME1 LOCALE_SABBREVDAYNAME2
  92. LOCALE_SABBREVDAYNAME3 LOCALE_SABBREVDAYNAME4
  93. LOCALE_SABBREVDAYNAME5 LOCALE_SABBREVDAYNAME6
  94. LOCALE_SABBREVDAYNAME7 LOCALE_SMONTHNAME1 LOCALE_SMONTHNAME2
  95. LOCALE_SMONTHNAME3 LOCALE_SMONTHNAME4 LOCALE_SMONTHNAME5
  96. LOCALE_SMONTHNAME6 LOCALE_SMONTHNAME7 LOCALE_SMONTHNAME8
  97. LOCALE_SMONTHNAME9 LOCALE_SMONTHNAME10 LOCALE_SMONTHNAME11
  98. LOCALE_SMONTHNAME12 LOCALE_SMONTHNAME13 LOCALE_SABBREVMONTHNAME1
  99. LOCALE_SABBREVMONTHNAME2 LOCALE_SABBREVMONTHNAME3
  100. LOCALE_SABBREVMONTHNAME4 LOCALE_SABBREVMONTHNAME5
  101. LOCALE_SABBREVMONTHNAME6 LOCALE_SABBREVMONTHNAME7
  102. LOCALE_SABBREVMONTHNAME8 LOCALE_SABBREVMONTHNAME9
  103. LOCALE_SABBREVMONTHNAME10 LOCALE_SABBREVMONTHNAME11
  104. LOCALE_SABBREVMONTHNAME12 LOCALE_SABBREVMONTHNAME13
  105. LOCALE_SPOSITIVESIGN LOCALE_SNEGATIVESIGN LOCALE_IPOSSIGNPOSN
  106. LOCALE_INEGSIGNPOSN LOCALE_IPOSSYMPRECEDES LOCALE_IPOSSEPBYSPACE
  107. LOCALE_INEGSYMPRECEDES LOCALE_INEGSEPBYSPACE)],
  108. TIME => [qw(TIME_NOMINUTESORSECONDS TIME_NOSECONDS TIME_NOTIMEMARKER
  109. TIME_FORCE24HOURFORMAT)],
  110. DATE => [qw(DATE_SHORTDATE DATE_LONGDATE DATE_USE_ALT_CALENDAR
  111. DATE_YEARMONTH DATE_LTRREADING DATE_RTLREADING)],
  112. );
  113. foreach my $tag (keys %EXPORT_TAGS) {
  114. push @EXPORT_OK, @{$EXPORT_TAGS{$tag}};
  115. }
  116. # Character Type Flags
  117. sub CT_CTYPE1 { 0x0001 }
  118. sub CT_CTYPE2 { 0x0002 }
  119. sub CT_CTYPE3 { 0x0004 }
  120. # Character Type 1 Bits
  121. sub C1_UPPER { 0x0001 }
  122. sub C1_LOWER { 0x0002 }
  123. sub C1_DIGIT { 0x0004 }
  124. sub C1_SPACE { 0x0008 }
  125. sub C1_PUNCT { 0x0010 }
  126. sub C1_CNTRL { 0x0020 }
  127. sub C1_BLANK { 0x0040 }
  128. sub C1_XDIGIT { 0x0080 }
  129. sub C1_ALPHA { 0x0100 }
  130. # Character Type 2 Bits
  131. sub C2_LEFTTORIGHT { 0x1 }
  132. sub C2_RIGHTTOLEFT { 0x2 }
  133. sub C2_EUROPENUMBER { 0x3 }
  134. sub C2_EUROPESEPARATOR { 0x4 }
  135. sub C2_EUROPETERMINATOR { 0x5 }
  136. sub C2_ARABICNUMBER { 0x6 }
  137. sub C2_COMMONSEPARATOR { 0x7 }
  138. sub C2_BLOCKSEPARATOR { 0x8 }
  139. sub C2_SEGMENTSEPARATOR { 0x9 }
  140. sub C2_WHITESPACE { 0xA }
  141. sub C2_OTHERNEUTRAL { 0xB }
  142. sub C2_NOTAPPLICABLE { 0x0 }
  143. # Character Type 3 Bits
  144. sub C3_NONSPACING { 0x0001 }
  145. sub C3_DIACRITIC { 0x0002 }
  146. sub C3_VOWELMARK { 0x0004 }
  147. sub C3_SYMBOL { 0x0008 }
  148. sub C3_KATAKANA { 0x0010 }
  149. sub C3_HIRAGANA { 0x0020 }
  150. sub C3_HALFWIDTH { 0x0040 }
  151. sub C3_FULLWIDTH { 0x0080 }
  152. sub C3_IDEOGRAPH { 0x0100 }
  153. sub C3_KASHIDA { 0x0200 }
  154. sub C3_ALPHA { 0x8000 }
  155. sub C3_NOTAPPLICABLE { 0x0 }
  156. # String Flags
  157. sub NORM_IGNORECASE { 0x0001 }
  158. sub NORM_IGNORENONSPACE { 0x0002 }
  159. sub NORM_IGNORESYMBOLS { 0x0004 }
  160. sub NORM_IGNOREWIDTH { 0x0008 }
  161. sub NORM_IGNOREKANATYPE { 0x0040 }
  162. sub NORM_IGNOREKASHIDA { 0x40000}
  163. # Locale Dependent Mapping Flags
  164. sub LCMAP_LOWERCASE { 0x0100 }
  165. sub LCMAP_UPPERCASE { 0x0200 }
  166. sub LCMAP_SORTKEY { 0x0400 }
  167. sub LCMAP_HALFWIDTH { 0x0800 }
  168. sub LCMAP_FULLWIDTH { 0x1000 }
  169. sub LCMAP_HIRAGANA { 0x2000 }
  170. sub LCMAP_KATAKANA { 0x4000 }
  171. # Primary Language Identifier
  172. sub LANG_NEUTRAL { 0x00 }
  173. sub LANG_ALBANIAN { 0x1c }
  174. sub LANG_ARABIC { 0x01 }
  175. sub LANG_BAHASA { 0x21 }
  176. sub LANG_BULGARIAN { 0x02 }
  177. sub LANG_CATALAN { 0x03 }
  178. sub LANG_CHINESE { 0x04 }
  179. sub LANG_CZECH { 0x05 }
  180. sub LANG_DANISH { 0x06 }
  181. sub LANG_DUTCH { 0x13 }
  182. sub LANG_ENGLISH { 0x09 }
  183. sub LANG_FINNISH { 0x0b }
  184. sub LANG_FRENCH { 0x0c }
  185. sub LANG_GERMAN { 0x07 }
  186. sub LANG_GREEK { 0x08 }
  187. sub LANG_HEBREW { 0x0d }
  188. sub LANG_HUNGARIAN { 0x0e }
  189. sub LANG_ICELANDIC { 0x0f }
  190. sub LANG_ITALIAN { 0x10 }
  191. sub LANG_JAPANESE { 0x11 }
  192. sub LANG_KOREAN { 0x12 }
  193. sub LANG_NORWEGIAN { 0x14 }
  194. sub LANG_POLISH { 0x15 }
  195. sub LANG_PORTUGUESE { 0x16 }
  196. sub LANG_RHAETO_ROMAN { 0x17 }
  197. sub LANG_ROMANIAN { 0x18 }
  198. sub LANG_RUSSIAN { 0x19 }
  199. sub LANG_SERBO_CROATIAN { 0x1a }
  200. sub LANG_SLOVAK { 0x1b }
  201. sub LANG_SPANISH { 0x0a }
  202. sub LANG_SWEDISH { 0x1d }
  203. sub LANG_THAI { 0x1e }
  204. sub LANG_TURKISH { 0x1f }
  205. sub LANG_URDU { 0x20 }
  206. # Sublanguage Identifier
  207. sub SUBLANG_NEUTRAL { 0x00 }
  208. sub SUBLANG_DEFAULT { 0x01 }
  209. sub SUBLANG_SYS_DEFAULT { 0x02 }
  210. sub SUBLANG_CHINESE_SIMPLIFIED { 0x02 }
  211. sub SUBLANG_CHINESE_TRADITIONAL { 0x01 }
  212. sub SUBLANG_DUTCH { 0x01 }
  213. sub SUBLANG_DUTCH_BELGIAN { 0x02 }
  214. sub SUBLANG_ENGLISH_US { 0x01 }
  215. sub SUBLANG_ENGLISH_UK { 0x02 }
  216. sub SUBLANG_ENGLISH_AUS { 0x03 }
  217. sub SUBLANG_ENGLISH_CAN { 0x04 }
  218. sub SUBLANG_ENGLISH_NZ { 0x05 }
  219. sub SUBLANG_ENGLISH_EIRE { 0x06 }
  220. sub SUBLANG_FRENCH { 0x01 }
  221. sub SUBLANG_FRENCH_BELGIAN { 0x02 }
  222. sub SUBLANG_FRENCH_CANADIAN { 0x03 }
  223. sub SUBLANG_FRENCH_SWISS { 0x04 }
  224. sub SUBLANG_GERMAN { 0x01 }
  225. sub SUBLANG_GERMAN_SWISS { 0x02 }
  226. sub SUBLANG_GERMAN_AUSTRIAN { 0x03 }
  227. sub SUBLANG_ITALIAN { 0x01 }
  228. sub SUBLANG_ITALIAN_SWISS { 0x02 }
  229. sub SUBLANG_NORWEGIAN_BOKMAL { 0x01 }
  230. sub SUBLANG_NORWEGIAN_NYNORSK { 0x02 }
  231. sub SUBLANG_PORTUGUESE { 0x02 }
  232. sub SUBLANG_PORTUGUESE_BRAZILIAN { 0x01 }
  233. sub SUBLANG_SERBO_CROATIAN_CYRILLIC { 0x02 }
  234. sub SUBLANG_SERBO_CROATIAN_LATIN { 0x01 }
  235. sub SUBLANG_SPANISH { 0x01 }
  236. sub SUBLANG_SPANISH_MEXICAN { 0x02 }
  237. sub SUBLANG_SPANISH_MODERN { 0x03 }
  238. # Country codes
  239. sub CTRY_DEFAULT { 0 }
  240. sub CTRY_AUSTRALIA { 61 }
  241. sub CTRY_AUSTRIA { 43 }
  242. sub CTRY_BELGIUM { 32 }
  243. sub CTRY_BRAZIL { 55 }
  244. sub CTRY_CANADA { 2 }
  245. sub CTRY_DENMARK { 45 }
  246. sub CTRY_FINLAND { 358 }
  247. sub CTRY_FRANCE { 33 }
  248. sub CTRY_GERMANY { 49 }
  249. sub CTRY_ICELAND { 354 }
  250. sub CTRY_IRELAND { 353 }
  251. sub CTRY_ITALY { 39 }
  252. sub CTRY_JAPAN { 81 }
  253. sub CTRY_MEXICO { 52 }
  254. sub CTRY_NETHERLANDS { 31 }
  255. sub CTRY_NEW_ZEALAND { 64 }
  256. sub CTRY_NORWAY { 47 }
  257. sub CTRY_PORTUGAL { 351 }
  258. sub CTRY_PRCHINA { 86 }
  259. sub CTRY_SOUTH_KOREA { 82 }
  260. sub CTRY_SPAIN { 34 }
  261. sub CTRY_SWEDEN { 46 }
  262. sub CTRY_SWITZERLAND { 41 }
  263. sub CTRY_TAIWAN { 886 }
  264. sub CTRY_UNITED_KINGDOM { 44 }
  265. sub CTRY_UNITED_STATES { 1 }
  266. # Locale Types
  267. sub LOCALE_NOUSEROVERRIDE { 0x80000000 }
  268. sub LOCALE_ILANGUAGE { 0x0001 }
  269. sub LOCALE_SLANGUAGE { 0x0002 }
  270. sub LOCALE_SENGLANGUAGE { 0x1001 }
  271. sub LOCALE_SABBREVLANGNAME { 0x0003 }
  272. sub LOCALE_SNATIVELANGNAME { 0x0004 }
  273. sub LOCALE_ICOUNTRY { 0x0005 }
  274. sub LOCALE_SCOUNTRY { 0x0006 }
  275. sub LOCALE_SENGCOUNTRY { 0x1002 }
  276. sub LOCALE_SABBREVCTRYNAME { 0x0007 }
  277. sub LOCALE_SNATIVECTRYNAME { 0x0008 }
  278. sub LOCALE_IDEFAULTLANGUAGE { 0x0009 }
  279. sub LOCALE_IDEFAULTCOUNTRY { 0x000A }
  280. sub LOCALE_IDEFAULTCODEPAGE { 0x000B }
  281. sub LOCALE_IDEFAULTANSICODEPAGE { 0x1004 }
  282. sub LOCALE_SLIST { 0x000C }
  283. sub LOCALE_IMEASURE { 0x000D }
  284. sub LOCALE_SDECIMAL { 0x000E }
  285. sub LOCALE_STHOUSAND { 0x000F }
  286. sub LOCALE_SGROUPING { 0x0010 }
  287. sub LOCALE_IDIGITS { 0x0011 }
  288. sub LOCALE_ILZERO { 0x0012 }
  289. sub LOCALE_INEGNUMBER { 0x1010 }
  290. sub LOCALE_SNATIVEDIGITS { 0x0013 }
  291. sub LOCALE_SCURRENCY { 0x0014 }
  292. sub LOCALE_SINTLSYMBOL { 0x0015 }
  293. sub LOCALE_SMONDECIMALSEP { 0x0016 }
  294. sub LOCALE_SMONTHOUSANDSEP { 0x0017 }
  295. sub LOCALE_SMONGROUPING { 0x0018 }
  296. sub LOCALE_ICURRDIGITS { 0x0019 }
  297. sub LOCALE_IINTLCURRDIGITS { 0x001A }
  298. sub LOCALE_ICURRENCY { 0x001B }
  299. sub LOCALE_INEGCURR { 0x001C }
  300. sub LOCALE_SDATE { 0x001D }
  301. sub LOCALE_STIME { 0x001E }
  302. sub LOCALE_SSHORTDATE { 0x001F }
  303. sub LOCALE_SLONGDATE { 0x0020 }
  304. sub LOCALE_STIMEFORMAT { 0x1003 }
  305. sub LOCALE_IDATE { 0x0021 }
  306. sub LOCALE_ILDATE { 0x0022 }
  307. sub LOCALE_ITIME { 0x0023 }
  308. sub LOCALE_ITIMEMARKPOSN { 0x1005 }
  309. sub LOCALE_ICENTURY { 0x0024 }
  310. sub LOCALE_ITLZERO { 0x0025 }
  311. sub LOCALE_IDAYLZERO { 0x0026 }
  312. sub LOCALE_IMONLZERO { 0x0027 }
  313. sub LOCALE_S1159 { 0x0028 }
  314. sub LOCALE_S2359 { 0x0029 }
  315. sub LOCALE_ICALENDARTYPE { 0x1009 }
  316. sub LOCALE_IOPTIONALCALENDAR { 0x100B }
  317. sub LOCALE_IFIRSTDAYOFWEEK { 0x100C }
  318. sub LOCALE_IFIRSTWEEKOFYEAR { 0x100D }
  319. sub LOCALE_SDAYNAME1 { 0x002A }
  320. sub LOCALE_SDAYNAME2 { 0x002B }
  321. sub LOCALE_SDAYNAME3 { 0x002C }
  322. sub LOCALE_SDAYNAME4 { 0x002D }
  323. sub LOCALE_SDAYNAME5 { 0x002E }
  324. sub LOCALE_SDAYNAME6 { 0x002F }
  325. sub LOCALE_SDAYNAME7 { 0x0030 }
  326. sub LOCALE_SABBREVDAYNAME1 { 0x0031 }
  327. sub LOCALE_SABBREVDAYNAME2 { 0x0032 }
  328. sub LOCALE_SABBREVDAYNAME3 { 0x0033 }
  329. sub LOCALE_SABBREVDAYNAME4 { 0x0034 }
  330. sub LOCALE_SABBREVDAYNAME5 { 0x0035 }
  331. sub LOCALE_SABBREVDAYNAME6 { 0x0036 }
  332. sub LOCALE_SABBREVDAYNAME7 { 0x0037 }
  333. sub LOCALE_SMONTHNAME1 { 0x0038 }
  334. sub LOCALE_SMONTHNAME2 { 0x0039 }
  335. sub LOCALE_SMONTHNAME3 { 0x003A }
  336. sub LOCALE_SMONTHNAME4 { 0x003B }
  337. sub LOCALE_SMONTHNAME5 { 0x003C }
  338. sub LOCALE_SMONTHNAME6 { 0x003D }
  339. sub LOCALE_SMONTHNAME7 { 0x003E }
  340. sub LOCALE_SMONTHNAME8 { 0x003F }
  341. sub LOCALE_SMONTHNAME9 { 0x0040 }
  342. sub LOCALE_SMONTHNAME10 { 0x0041 }
  343. sub LOCALE_SMONTHNAME11 { 0x0042 }
  344. sub LOCALE_SMONTHNAME12 { 0x0043 }
  345. sub LOCALE_SMONTHNAME13 { 0x100E }
  346. sub LOCALE_SABBREVMONTHNAME1 { 0x0044 }
  347. sub LOCALE_SABBREVMONTHNAME2 { 0x0045 }
  348. sub LOCALE_SABBREVMONTHNAME3 { 0x0046 }
  349. sub LOCALE_SABBREVMONTHNAME4 { 0x0047 }
  350. sub LOCALE_SABBREVMONTHNAME5 { 0x0048 }
  351. sub LOCALE_SABBREVMONTHNAME6 { 0x0049 }
  352. sub LOCALE_SABBREVMONTHNAME7 { 0x004A }
  353. sub LOCALE_SABBREVMONTHNAME8 { 0x004B }
  354. sub LOCALE_SABBREVMONTHNAME9 { 0x004C }
  355. sub LOCALE_SABBREVMONTHNAME10 { 0x004D }
  356. sub LOCALE_SABBREVMONTHNAME11 { 0x004E }
  357. sub LOCALE_SABBREVMONTHNAME12 { 0x004F }
  358. sub LOCALE_SABBREVMONTHNAME13 { 0x100F }
  359. sub LOCALE_SPOSITIVESIGN { 0x0050 }
  360. sub LOCALE_SNEGATIVESIGN { 0x0051 }
  361. sub LOCALE_IPOSSIGNPOSN { 0x0052 }
  362. sub LOCALE_INEGSIGNPOSN { 0x0053 }
  363. sub LOCALE_IPOSSYMPRECEDES { 0x0054 }
  364. sub LOCALE_IPOSSEPBYSPACE { 0x0055 }
  365. sub LOCALE_INEGSYMPRECEDES { 0x0056 }
  366. sub LOCALE_INEGSEPBYSPACE { 0x0057 }
  367. # GetTimeFormat Flags
  368. sub TIME_NOMINUTESORSECONDS { 0x0001 }
  369. sub TIME_NOSECONDS { 0x0002 }
  370. sub TIME_NOTIMEMARKER { 0x0004 }
  371. sub TIME_FORCE24HOURFORMAT { 0x0008 }
  372. # GetDateFormat Flags
  373. sub DATE_SHORTDATE { 0x0001 }
  374. sub DATE_LONGDATE { 0x0002 }
  375. sub DATE_USE_ALT_CALENDAR { 0x0004 }
  376. sub DATE_YEARMONTH { 0x0008 }
  377. sub DATE_LTRREADING { 0x0010 }
  378. sub DATE_RTLREADING { 0x0020 }
  379. # Language Identifier Functions
  380. sub MAKELANGID { my ($p,$s) = @_; (($s & 0xffff) << 10) | ($p & 0xffff); }
  381. sub PRIMARYLANGID { my $lgid = shift; $lgid & 0x3ff; }
  382. sub SUBLANGID { my $lgid = shift; ($lgid >> 10) & 0x3f; }
  383. sub LANG_SYSTEM_DEFAULT { MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT); }
  384. sub LANG_USER_DEFAULT { MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT); }
  385. # Locale Identifier Functions
  386. sub MAKELCID { my $lgid = shift; $lgid & 0xffff; }
  387. sub LANGIDFROMLCID { my $lcid = shift; $lcid & 0xffff; }
  388. sub LOCALE_SYSTEM_DEFAULT { MAKELCID(LANG_SYSTEM_DEFAULT); }
  389. sub LOCALE_USER_DEFAULT { MAKELCID(LANG_USER_DEFAULT); }
  390. 1;
  391. __END__
  392. =head1 NAME
  393. Win32::OLE::NLS - OLE National Language Support
  394. =head1 SYNOPSIS
  395. missing
  396. =head1 DESCRIPTION
  397. This module provides access to the national language support features
  398. in the F<OLENLS.DLL>.
  399. =head2 Functions
  400. =over 8
  401. =item CompareString(LCID,FLAGS,STR1,STR2)
  402. Compare STR1 and STR2 in the LCID locale. FLAGS indicate the character
  403. traits to be used or ignored when comparing the two strings.
  404. NORM_IGNORECASE Ignore case
  405. NORM_IGNOREKANATYPE Ignore hiragana/katakana character differences
  406. NORM_IGNORENONSPACE Ignore accents, diacritics, and vowel marks
  407. NORM_IGNORESYMBOLS Ignore symbols
  408. NORM_IGNOREWIDTH Ignore character width
  409. Possible return values are:
  410. 0 Function failed
  411. 1 STR1 is less than STR2
  412. 2 STR1 is equal to STR2
  413. 3 STR1 is greater than STR2
  414. Note that you can subtract 2 from the return code to get values
  415. comparable to the C<cmp> operator.
  416. =item LCMapString(LCID,FLAGS,STR)
  417. LCMapString translates STR using LCID dependent translation.
  418. Flags contains a combination of the following options:
  419. LCMAP_LOWERCASE Lowercase
  420. LCMAP_UPPERCASE Uppercase
  421. LCMAP_HALFWIDTH Narrow characters
  422. LCMAP_FULLWIDTH Wide characters
  423. LCMAP_HIRAGANA Hiragana
  424. LCMAP_KATAKANA Katakana
  425. LCMAP_SORTKEY Character sort key
  426. The following normalization options can be combined with C<LCMAP_SORTKEY>:
  427. NORM_IGNORECASE Ignore case
  428. NORM_IGNOREKANATYPE Ignore hiragana/katakana character differences
  429. NORM_IGNORENONSPACE Ignore accents, diacritics, and vowel marks
  430. NORM_IGNORESYMBOLS Ignore symbols
  431. NORM_IGNOREWIDTH Ignore character width
  432. The return value is the translated string.
  433. =item GetLocaleInfo(LCID,LCTYPE)
  434. Retrieve locale setting LCTYPE from the locale specified by LCID. Use
  435. LOCALE_NOUSEROVERRIDE | LCTYPE to always query the locale database.
  436. Otherwise user changes to C<win.ini> through the windows control panel
  437. take precedence when retrieving values for the system default locale.
  438. See the documentation below for a list of valid LCTYPE values.
  439. The return value is the contents of the requested locale setting.
  440. =item GetStringType(LCID,TYPE,STR)
  441. Retrieve type information from locale LCID about each character in STR.
  442. The requested TYPE can be one of the following 3 levels:
  443. CT_CTYPE1 ANSI C and POSIX type information
  444. CT_CTYPE2 Text layout type information
  445. CT_CTYPE3 Text processing type information
  446. The return value is a list of values, each of wich is a bitwise OR of
  447. the applicable type bits from the corresponding table below:
  448. @ct = GetStringType(LOCALE_SYSTEM_DEFAULT, CT_CTYPE1, "String");
  449. ANSI C and POSIX character type information:
  450. C1_UPPER Uppercase
  451. C1_LOWER Lowercase
  452. C1_DIGIT Decimal digits
  453. C1_SPACE Space characters
  454. C1_PUNCT Punctuation
  455. C1_CNTRL Control characters
  456. C1_BLANK Blank characters
  457. C1_XDIGIT Hexadecimal digits
  458. C1_ALPHA Any letter
  459. Text layout type information:
  460. C2_LEFTTORIGHT Left to right
  461. C2_RIGHTTOLEFT Right to left
  462. C2_EUROPENUMBER European number, European digit
  463. C2_EUROPESEPARATOR European numeric separator
  464. C2_EUROPETERMINATOR European numeric terminator
  465. C2_ARABICNUMBER Arabic number
  466. C2_COMMONSEPARATOR Common numeric separator
  467. C2_BLOCKSEPARATOR Block separator
  468. C2_SEGMENTSEPARATOR Segment separator
  469. C2_WHITESPACE White space
  470. C2_OTHERNEUTRAL Other neutrals
  471. C2_NOTAPPLICABLE No implicit direction (e.g. ctrl codes)
  472. Text precessing type information:
  473. C3_NONSPACING Nonspacing mark
  474. C3_DIACRITIC Diacritic nonspacing mark
  475. C3_VOWELMARK Vowel nonspacing mark
  476. C3_SYMBOL Symbol
  477. C3_KATAKANA Katakana character
  478. C3_HIRAGANA Hiragana character
  479. C3_HALFWIDTH Narrow character
  480. C3_FULLWIDTH Wide character
  481. C3_IDEOGRAPH Ideograph
  482. C3_ALPHA Any letter
  483. C3_NOTAPPLICABLE Not applicable
  484. =item GetSystemDefaultLangID()
  485. Returns the system default language identifier.
  486. =item GetSystemDefaultLCID()
  487. Returns the system default locale identifier.
  488. =item GetUserDefaultLangID()
  489. Returns the user default language identifier.
  490. =item GetUserDefaultLCID()
  491. Returns the user default locale identifier.
  492. =item SendSettingChange()
  493. Sends a WM_SETTINGCHANGE message to all top level windows.
  494. =item SetLocaleInfo(LCID, LCTYPE, LCDATA)
  495. Changes an item in the user override part of the locale setting LCID.
  496. It doesn't change the system default database. The following LCTYPEs are
  497. changeable:
  498. LOCALE_ICALENDARTYPE LOCALE_SDATE
  499. LOCALE_ICURRDIGITS LOCALE_SDECIMAL
  500. LOCALE_ICURRENCY LOCALE_SGROUPING
  501. LOCALE_IDIGITS LOCALE_SLIST
  502. LOCALE_IFIRSTDAYOFWEEK LOCALE_SLONGDATE
  503. LOCALE_IFIRSTWEEKOFYEAR LOCALE_SMONDECIMALSEP
  504. LOCALE_ILZERO LOCALE_SMONGROUPING
  505. LOCALE_IMEASURE LOCALE_SMONTHOUSANDSEP
  506. LOCALE_INEGCURR LOCALE_SNEGATIVESIGN
  507. LOCALE_INEGNUMBER LOCALE_SPOSITIVESIGN
  508. LOCALE_IPAPERSIZE LOCALE_SSHORTDATE
  509. LOCALE_ITIME LOCALE_STHOUSAND
  510. LOCALE_S1159 LOCALE_STIME
  511. LOCALE_S2359 LOCALE_STIMEFORMAT
  512. LOCALE_SCURRENCY LOCALE_SYEARMONTH
  513. You have to call SendSettingChange() to activate these changes for
  514. subsequent Win32::OLE::Variant object formatting because the OLE
  515. subsystem seems to cache locale information.
  516. =item MAKELANGID(LANG,SUBLANG)
  517. Creates a lnguage identifier from a primary language and a sublanguage.
  518. =item PRIMARYLANGID(LANGID)
  519. Retrieves the primary language from a language identifier.
  520. =item SUBLANGID(LANGID)
  521. Retrieves the sublanguage from a language identifier.
  522. =item MAKELCID(LANGID)
  523. Creates a locale identifies from a language identifier.
  524. =item LANGIDFROMLCID(LCID)
  525. Retrieves a language identifier from a locale identifier.
  526. =back
  527. =head2 Locale Types
  528. =over 8
  529. =item LOCALE_ILANGUAGE
  530. The language identifier (in hex).
  531. =item LOCALE_SLANGUAGE
  532. The localized name of the language.
  533. =item LOCALE_SENGLANGUAGE
  534. The ISO Standard 639 English name of the language.
  535. =item LOCALE_SABBREVLANGNAME
  536. The three-letter abbreviated name of the language. The first two
  537. letters are from the ISO Standard 639 language name abbreviation. The
  538. third letter indicates the sublanguage type.
  539. =item LOCALE_SNATIVELANGNAME
  540. The native name of the language.
  541. =item LOCALE_ICOUNTRY
  542. The country code, which is based on international phone codes.
  543. =item LOCALE_SCOUNTRY
  544. The localized name of the country.
  545. =item LOCALE_SENGCOUNTRY
  546. The English name of the country.
  547. =item LOCALE_SABBREVCTRYNAME
  548. The ISO Standard 3166 abbreviated name of the country.
  549. =item LOCALE_SNATIVECTRYNAME
  550. The native name of the country.
  551. =item LOCALE_IDEFAULTLANGUAGE
  552. Language identifier for the principal language spoken in this
  553. locale.
  554. =item LOCALE_IDEFAULTCOUNTRY
  555. Country code for the principal country in this locale.
  556. =item LOCALE_IDEFAULTANSICODEPAGE
  557. The ANSI code page associated with this locale. Format: 4 Unicode
  558. decimal digits plus a Unicode null terminator.
  559. XXX This should be translated by GetLocaleInfo. XXX
  560. =item LOCALE_IDEFAULTCODEPAGE
  561. The OEM code page associated with the country.
  562. =item LOCALE_SLIST
  563. Characters used to separate list items (often a comma).
  564. =item LOCALE_IMEASURE
  565. Default measurement system:
  566. 0 metric system (S.I.)
  567. 1 U.S. system
  568. =item LOCALE_SDECIMAL
  569. Characters used for the decimal separator (often a dot).
  570. =item LOCALE_STHOUSAND
  571. Characters used as the separator between groups of digits left of the decimal.
  572. =item LOCALE_SGROUPING
  573. Sizes for each group of digits to the left of the decimal. An explicit
  574. size is required for each group. Sizes are separated by semicolons. If
  575. the last value is 0, the preceding value is repeated. To group
  576. thousands, specify 3;0.
  577. =item LOCALE_IDIGITS
  578. The number of fractional digits.
  579. =item LOCALE_ILZERO
  580. Whether to use leading zeros in decimal fields. A setting of 0
  581. means use no leading zeros; 1 means use leading zeros.
  582. =item LOCALE_SNATIVEDIGITS
  583. The ten characters that are the native equivalent of the ASCII 0-9.
  584. =item LOCALE_INEGNUMBER
  585. Negative number mode.
  586. 0 (1.1)
  587. 1 -1.1
  588. 2 -1.1
  589. 3 1.1
  590. 4 1.1
  591. =item LOCALE_SCURRENCY
  592. The string used as the local monetary symbol.
  593. =item LOCALE_SINTLSYMBOL
  594. Three characters of the International monetary symbol specified in ISO
  595. 4217, Codes for the Representation of Currencies and Funds, followed
  596. by the character separating this string from the amount.
  597. =item LOCALE_SMONDECIMALSEP
  598. Characters used for the monetary decimal separators.
  599. =item LOCALE_SMONTHOUSANDSEP
  600. Characters used as monetary separator between groups of digits left of
  601. the decimal.
  602. =item LOCALE_SMONGROUPING
  603. Sizes for each group of monetary digits to the left of the decimal. An
  604. explicit size is needed for each group. Sizes are separated by
  605. semicolons. If the last value is 0, the preceding value is
  606. repeated. To group thousands, specify 3;0.
  607. =item LOCALE_ICURRDIGITS
  608. Number of fractional digits for the local monetary format.
  609. =item LOCALE_IINTLCURRDIGITS
  610. Number of fractional digits for the international monetary format.
  611. =item LOCALE_ICURRENCY
  612. Positive currency mode.
  613. 0 Prefix, no separation.
  614. 1 Suffix, no separation.
  615. 2 Prefix, 1-character separation.
  616. 3 Suffix, 1-character separation.
  617. =item LOCALE_INEGCURR
  618. Negative currency mode.
  619. 0 ($1.1)
  620. 1 -$1.1
  621. 2 $-1.1
  622. 3 $1.1-
  623. 4 $(1.1$)
  624. 5 -1.1$
  625. 6 1.1-$
  626. 7 1.1$-
  627. 8 -1.1 $ (space before $)
  628. 9 -$ 1.1 (space after $)
  629. 10 1.1 $- (space before $)
  630. =item LOCALE_ICALENDARTYPE
  631. The type of calendar currently in use.
  632. 1 Gregorian (as in U.S.)
  633. 2 Gregorian (always English strings)
  634. 3 Era: Year of the Emperor (Japan)
  635. 4 Era: Year of the Republic of China
  636. 5 Tangun Era (Korea)
  637. =item LOCALE_IOPTIONALCALENDAR
  638. The additional calendar types available for this LCID. Can be a
  639. null-separated list of all valid optional calendars. Value is
  640. 0 for "None available" or any of the LOCALE_ICALENDARTYPE settings.
  641. XXX null separated list should be translated by GetLocaleInfo XXX
  642. =item LOCALE_SDATE
  643. Characters used for the date separator.
  644. =item LOCALE_STIME
  645. Characters used for the time separator.
  646. =item LOCALE_STIMEFORMAT
  647. Time-formatting string.
  648. =item LOCALE_SSHORTDATE
  649. Short Date_Time formatting strings for this locale.
  650. =item LOCALE_SLONGDATE
  651. Long Date_Time formatting strings for this locale.
  652. =item LOCALE_IDATE
  653. Short Date format-ordering specifier.
  654. 0 Month - Day - Year
  655. 1 Day - Month - Year
  656. 2 Year - Month - Day
  657. =item LOCALE_ILDATE
  658. Long Date format ordering specifier. Value can be any of the valid
  659. LOCALE_IDATE settings.
  660. =item LOCALE_ITIME
  661. Time format specifier.
  662. 0 AM/PM 12-hour format.
  663. 1 24-hour format.
  664. =item LOCALE_ITIMEMARKPOSN
  665. Whether the time marker string (AM|PM) precedes or follows the time
  666. string.
  667. 0 Suffix (9:15 AM).
  668. 1 Prefix (AM 9:15).
  669. =item LOCALE_ICENTURY
  670. Whether to use full 4-digit century.
  671. 0 Two digit.
  672. 1 Full century.
  673. =item LOCALE_ITLZERO
  674. Whether to use leading zeros in time fields.
  675. 0 No leading zeros.
  676. 1 Leading zeros for hours.
  677. =item LOCALE_IDAYLZERO
  678. Whether to use leading zeros in day fields. Values as for
  679. LOCALE_ITLZERO.
  680. =item LOCALE_IMONLZERO
  681. Whether to use leading zeros in month fields. Values as for
  682. LOCALE_ITLZERO.
  683. =item LOCALE_S1159
  684. String for the AM designator.
  685. =item LOCALE_S2359
  686. String for the PM designator.
  687. =item LOCALE_IFIRSTWEEKOFYEAR
  688. Specifies which week of the year is considered first.
  689. 0 Week containing 1/1 is the first week of the year.
  690. 1 First full week following 1/1is the first week of the year.
  691. 2 First week with at least 4 days is the first week of the year.
  692. =item LOCALE_IFIRSTDAYOFWEEK
  693. Specifies the day considered first in the week. Value "0" means
  694. SDAYNAME1 and value "6" means SDAYNAME7.
  695. =item LOCALE_SDAYNAME1 .. LOCALE_SDAYNAME7
  696. Long name for Monday .. Sunday.
  697. =item LOCALE_SABBREVDAYNAME1 .. LOCALE_SABBREVDAYNAME7
  698. Abbreviated name for Monday .. Sunday.
  699. =item LOCALE_SMONTHNAME1 .. LOCALE_SMONTHNAME12
  700. Long name for January .. December.
  701. =item LOCALE_SMONTHNAME13
  702. Native name for 13th month, if it exists.
  703. =item LOCALE_SABBREVMONTHNAME1 .. LOCALE_SABBREVMONTHNAME12
  704. Abbreviated name for January .. December.
  705. =item LOCALE_SABBREVMONTHNAME13
  706. Native abbreviated name for 13th month, if it exists.
  707. =item LOCALE_SPOSITIVESIGN
  708. String value for the positive sign.
  709. =item LOCALE_SNEGATIVESIGN
  710. String value for the negative sign.
  711. =item LOCALE_IPOSSIGNPOSN
  712. Formatting index for positive values.
  713. 0 Parentheses surround the amount and the monetary symbol.
  714. 1 The sign string precedes the amount and the monetary symbol.
  715. 2 The sign string precedes the amount and the monetary symbol.
  716. 3 The sign string precedes the amount and the monetary symbol.
  717. 4 The sign string precedes the amount and the monetary symbol.
  718. =item LOCALE_INEGSIGNPOSN
  719. Formatting index for negative values. Values as for LOCALE_IPOSSIGNPOSN.
  720. =item LOCALE_IPOSSYMPRECEDES
  721. If the monetary symbol precedes, 1. If it succeeds a positive amount, 0.
  722. =item LOCALE_IPOSSEPBYSPACE
  723. If the monetary symbol is separated by a space from a positive amount,
  724. 1. Otherwise, 0.
  725. =item LOCALE_INEGSYMPRECEDES
  726. If the monetary symbol precedes, 1. If it succeeds a negative amount, 0.
  727. =item LOCALE_INEGSEPBYSPACE
  728. If the monetary symbol is separated by a space from a negative amount,
  729. 1. Otherwise, 0.
  730. =back
  731. =head1 AUTHORS/COPYRIGHT
  732. This module is part of the Win32::OLE distribution.
  733. =cut