windows-pr 0.2.0 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ module Windows
9
9
  Memcmp = Win32API.new('msvcrt', 'memcmp', 'PPL', 'I')
10
10
  Memicmp = Win32API.new('msvcrt', '_memicmp', 'PPL', 'I')
11
11
  Memmove = Win32API.new('msvcrt', 'memmove', 'PPL', 'P')
12
- Memset = Win32API.new('msvcrt', 'memset', 'PLL', 'P')
12
+ Memset = Win32API.new('msvcrt', 'memset', 'PLL', 'L')
13
13
  Swab = Win32API.new('msvcrt', '_swab', 'PPI', 'V')
14
14
 
15
15
  def memcpy(dest, src, size)
@@ -0,0 +1,46 @@
1
+ require 'Win32API'
2
+
3
+ module Windows
4
+ module MSVCRT
5
+ module String
6
+ Strcpy = Win32API.new('msvcrt', 'strcpy', 'PL', 'l')
7
+ Strrev = Win32API.new('msvcrt', '_strrev', 'P', 'P')
8
+
9
+ Mbscpy = Win32API.new('msvcrt', '_mbscpy', 'PL', 'L')
10
+ Mbsrev = Win32API.new('msvcrt', '_mbsrev', 'P', 'P')
11
+
12
+ Wcscpy = Win32API.new('msvcrt', 'wcscpy', 'PL', 'l')
13
+ Wcsrev = Win32API.new('msvcrt', '_wcsrev', 'P', 'P')
14
+
15
+ def strcpy(dest, src)
16
+ return nil if src == 0
17
+ Strcpy.call(dest, src)
18
+ end
19
+
20
+ def strrev(str)
21
+ return nil if str == 0
22
+ Strrev.call(str)
23
+ end
24
+
25
+ def mbscpy(dest, src)
26
+ return nil if src == 0
27
+ Mbscpy.call(dest, src)
28
+ end
29
+
30
+ def mbsrev(str)
31
+ return nil if str == 0
32
+ Mbsrev.call(str)
33
+ end
34
+
35
+ def wcscpy(dest, src)
36
+ return nil if src == 0
37
+ Wcscpy.call(dest, src)
38
+ end
39
+
40
+ def wcsrev(str)
41
+ return nil if str == 0
42
+ Wcsrev.call(str)
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,557 @@
1
+ require 'Win32API'
2
+
3
+ module Windows
4
+ module National
5
+ # Code page identifiers. Used for get_acp_string method.
6
+ CODE_PAGE = {
7
+ 037 => 'IBM EBCDIC = U.S./Canada',
8
+ 437 => 'OEM = United States',
9
+ 500 => 'IBM EBCDIC - International',
10
+ 708 => 'Arabic - ASMO 708',
11
+ 709 => 'Arabic - ASMO 449+, BCON V4',
12
+ 710 => 'Arabic - Transparent Arabic',
13
+ 720 => 'Arabic - Transparent ASMO',
14
+ 737 => 'OEM - Greek (formerly 437G)',
15
+ 775 => 'OEM - Baltic',
16
+ 850 => 'OEM - Multilingual Latin I',
17
+ 852 => 'OEM - Latin II',
18
+ 855 => 'OEM - Cyrillic (primarily Russian)',
19
+ 857 => 'OEM - Turkish',
20
+ 858 => 'OEM - Multilingual Latin I + Euro symbol',
21
+ 860 => 'OEM - Portuguese',
22
+ 861 => 'OEM - Icelandic',
23
+ 862 => 'OEM - Hebrew',
24
+ 863 => 'OEM - Canadian-French',
25
+ 864 => 'OEM - Arabic',
26
+ 865 => 'OEM - Nordic',
27
+ 866 => 'OEM - Russian',
28
+ 869 => 'OEM - Modern Greek',
29
+ 870 => 'IBM EBCDIC - Multilingual/ROECE (Latin-2)',
30
+ 874 => 'ANSI/OEM - Thai (same as 28605, ISO 8859-15)',
31
+ 875 => 'IBM EBCDIC - Modern Greek',
32
+ 932 => 'ANSI/OEM - Japanese, Shift-JIS',
33
+ 936 => 'ANSI/OEM - Simplified Chinese (PRC, Singapore)',
34
+ 949 => 'ANSI/OEM - Korean (Unified Hangul Code)',
35
+ 950 => 'ANSI/OEM - Traditional Chinese (Taiwan; Hong Kong SAR, PRC)',
36
+ 1026 => 'IBM EBCDIC - Turkish (Latin-5)',
37
+ 1047 => 'IBM EBCDIC - Latin 1/Open System',
38
+ 1140 => 'IBM EBCDIC - U.S./Canada (037 + Euro symbol)',
39
+ 1141 => 'IBM EBCDIC - Germany (20273 + Euro symbol)',
40
+ 1142 => 'IBM EBCDIC - Denmark/Norway (20277 + Euro symbol)',
41
+ 1143 => 'IBM EBCDIC - Finland/Sweden (20278 + Euro symbol)',
42
+ 1144 => 'IBM EBCDIC - Italy (20280 + Euro symbol)',
43
+ 1145 => 'IBM EBCDIC - Latin America/Spain (20284 + Euro symbol)',
44
+ 1146 => 'IBM EBCDIC - United Kingdom (20285 + Euro symbol)',
45
+ 1147 => 'IBM EBCDIC - France (20297 + Euro symbol)',
46
+ 1148 => 'IBM EBCDIC - International (500 + Euro symbol)',
47
+ 1149 => 'IBM EBCDIC - Icelandic (20871 + Euro symbol)',
48
+ 1200 => 'Unicode UCS-2 Little-Endian (BMP of ISO 10646)',
49
+ 1201 => 'Unicode UCS-2 Big-Endian',
50
+ 1250 => 'ANSI - Central European',
51
+ 1251 => 'ANSI - Cyrillic',
52
+ 1252 => 'ANSI - Latin I',
53
+ 1253 => 'ANSI - Greek',
54
+ 1254 => 'ANSI - Turkish',
55
+ 1255 => 'ANSI - Hebrew',
56
+ 1256 => 'ANSI - Arabic',
57
+ 1257 => 'ANSI - Baltic',
58
+ 1258 => 'ANSI/OEM - Vietnamese',
59
+ 1361 => 'Korean (Johab)',
60
+ 10000 => 'MAC - Roman',
61
+ 10001 => 'MAC - Japanese',
62
+ 10002 => 'MAC - Traditional Chinese (Big5)',
63
+ 10003 => 'MAC - Korean',
64
+ 10004 => 'MAC - Arabic',
65
+ 10005 => 'MAC - Hebrew',
66
+ 10006 => 'MAC - Greek I',
67
+ 10007 => 'MAC - Cyrillic',
68
+ 10008 => 'MAC - Simplified Chinese (GB 2312)',
69
+ 10010 => 'MAC - Romania',
70
+ 10017 => 'MAC - Ukraine',
71
+ 10021 => 'MAC - Thai',
72
+ 10029 => 'MAC - Latin II',
73
+ 10079 => 'MAC - Icelandic',
74
+ 10081 => 'MAC - Turkish',
75
+ 10082 => 'MAC - Croatia',
76
+ 12000 => 'Unicode UCS-4 Little-Endian',
77
+ 12001 => 'Unicode UCS-4 Big-Endian',
78
+ 20000 => 'CNS - Taiwan',
79
+ 20001 => 'TCA - Taiwan',
80
+ 20002 => 'Eten - Taiwan',
81
+ 20003 => 'IBM5550 - Taiwan',
82
+ 20004 => 'TeleText - Taiwan',
83
+ 20005 => 'Wang - Taiwan',
84
+ 20105 => 'IA5 IRV International Alphabet No. 5 (7-bit)',
85
+ 20106 => 'IA5 German (7-bit)',
86
+ 20107 => 'IA5 Swedish (7-bit)',
87
+ 20108 => 'IA5 Norwegian (7-bit)',
88
+ 20127 => 'US-ASCII (7-bit)',
89
+ 20261 => 'T.61',
90
+ 20269 => 'ISO 6937 Non-Spacing Accent',
91
+ 20273 => 'IBM EBCDIC - Germany',
92
+ 20277 => 'IBM EBCDIC - Denmark/Norway',
93
+ 20278 => 'IBM EBCDIC - Finland/Sweden',
94
+ 20280 => 'IBM EBCDIC - Italy',
95
+ 20284 => 'IBM EBCDIC - Latin America/Spain',
96
+ 20285 => 'IBM EBCDIC - United Kingdom',
97
+ 20290 => 'IBM EBCDIC - Japanese Katakana Extended',
98
+ 20297 => 'IBM EBCDIC - France',
99
+ 20420 => 'IBM EBCDIC - Arabic',
100
+ 20423 => 'IBM EBCDIC - Greek',
101
+ 20424 => 'IBM EBCDIC - Hebrew',
102
+ 20833 => 'IBM EBCDIC - Korean Extended',
103
+ 20838 => 'IBM EBCDIC - Thai',
104
+ 20866 => 'Russian - KOI8-R',
105
+ 20871 => 'IBM EBCDIC - Icelandic',
106
+ 20880 => 'IBM EBCDIC - Cyrillic (Russian)',
107
+ 20905 => 'IBM EBCDIC - Turkish',
108
+ 20924 => 'IBM EBCDIC - Latin-1/Open System (1047 + Euro symbol)',
109
+ 20932 => 'JIS X 0208-1990 & 0121-1990',
110
+ 20936 => 'Simplified Chinese (GB2312)',
111
+ 21025 => 'IBM EBCDIC - Cyrillic (Serbian, Bulgarian)',
112
+ 21027 => '(deprecated)',
113
+ 21866 => 'Ukrainian (KOI8-U)',
114
+ 28591 => 'ISO 8859-1 Latin I',
115
+ 28592 => 'ISO 8859-2 Central Europe',
116
+ 28593 => 'ISO 8859-3 Latin 3',
117
+ 28594 => 'ISO 8859-4 Baltic',
118
+ 28595 => 'ISO 8859-5 Cyrillic',
119
+ 28596 => 'ISO 8859-6 Arabic',
120
+ 28597 => 'ISO 8859-7 Greek',
121
+ 28598 => 'ISO 8859-8 Hebrew',
122
+ 28599 => 'ISO 8859-9 Latin 5',
123
+ 28605 => 'ISO 8859-15 Latin 9',
124
+ 29001 => 'Europa 3',
125
+ 38598 => 'ISO 8859-8 Hebrew',
126
+ 50220 => 'ISO 2022 Japanese with no halfwidth Katakana',
127
+ 50221 => 'ISO 2022 Japanese with halfwidth Katakana',
128
+ 50222 => 'ISO 2022 Japanese JIS X 0201-1989',
129
+ 50225 => 'ISO 2022 Korean',
130
+ 50227 => 'ISO 2022 Simplified Chinese',
131
+ 50229 => 'ISO 2022 Traditional Chinese',
132
+ 50930 => 'Japanese (Katakana) Extended',
133
+ 50931 => 'US/Canada and Japanese',
134
+ 50933 => 'Korean Extended and Korean',
135
+ 50935 => 'Simplified Chinese Extended and Simplified Chinese',
136
+ 50936 => 'Simplified Chinese',
137
+ 50937 => 'US/Canada and Traditional Chinese',
138
+ 50939 => 'Japanese (Latin) Extended and Japanese',
139
+ 51932 => 'EUC - Japanese',
140
+ 51936 => 'EUC - Simplified Chinese',
141
+ 51949 => 'EUC - Korean',
142
+ 51950 => 'EUC - Traditional Chinese',
143
+ 52936 => 'HZ-GB2312 Simplified Chinese',
144
+ 54936 => 'Windows XP: GB18030 Simplified Chinese (4 Byte)',
145
+ 57002 => 'ISCII Devanagari',
146
+ 57003 => 'ISCII Bengali',
147
+ 57004 => 'ISCII Tamil',
148
+ 57005 => 'ISCII Telugu',
149
+ 57006 => 'ISCII Assamese',
150
+ 57007 => 'ISCII Oriya',
151
+ 57008 => 'ISCII Kannada',
152
+ 57009 => 'ISCII Malayalam',
153
+ 57010 => 'ISCII Gujarati',
154
+ 57011 => 'ISCII Punjabi',
155
+ 65000 => 'Unicode UTF-7',
156
+ 65001 => 'Unicode UTF-8'
157
+ }
158
+
159
+ LANG_NEUTRAL = 0x00
160
+ LANG_INVARIANT = 0x7f
161
+
162
+ LANG_AFRIKAANS = 0x36
163
+ LANG_ALBANIAN = 0x1c
164
+ LANG_ARABIC = 0x01
165
+ LANG_ARMENIAN = 0x2b
166
+ LANG_ASSAMESE = 0x4d
167
+ LANG_AZERI = 0x2c
168
+ LANG_BASQUE = 0x2d
169
+ LANG_BELARUSIAN = 0x23
170
+ LANG_BENGALI = 0x45
171
+ LANG_BOSNIAN = 0x1a
172
+ LANG_BULGARIAN = 0x02
173
+ LANG_CATALAN = 0x03
174
+ LANG_CHINESE = 0x04
175
+ LANG_CROATIAN = 0x1a
176
+ LANG_CZECH = 0x05
177
+ LANG_DANISH = 0x06
178
+ LANG_DIVEHI = 0x65
179
+ LANG_DUTCH = 0x13
180
+ LANG_ENGLISH = 0x09
181
+ LANG_ESTONIAN = 0x25
182
+ LANG_FAEROESE = 0x38
183
+ LANG_FARSI = 0x29
184
+ LANG_FINNISH = 0x0b
185
+ LANG_FRENCH = 0x0c
186
+ LANG_GALICIAN = 0x56
187
+ LANG_GEORGIAN = 0x37
188
+ LANG_GERMAN = 0x07
189
+ LANG_GREEK = 0x08
190
+ LANG_GUJARATI = 0x47
191
+ LANG_HEBREW = 0x0d
192
+ LANG_HINDI = 0x39
193
+ LANG_HUNGARIAN = 0x0e
194
+ LANG_ICELANDIC = 0x0f
195
+ LANG_INDONESIAN = 0x21
196
+ LANG_ITALIAN = 0x10
197
+ LANG_JAPANESE = 0x11
198
+ LANG_KANNADA = 0x4b
199
+ LANG_KASHMIRI = 0x60
200
+ LANG_KAZAK = 0x3f
201
+ LANG_KONKANI = 0x57
202
+ LANG_KOREAN = 0x12
203
+ LANG_KYRGYZ = 0x40
204
+ LANG_LATVIAN = 0x26
205
+ LANG_LITHUANIAN = 0x27
206
+ LANG_MACEDONIAN = 0x2f
207
+ LANG_MALAY = 0x3e
208
+ LANG_MALAYALAM = 0x4c
209
+ LANG_MALTESE = 0x3a
210
+ LANG_MANIPURI = 0x58
211
+ LANG_MAORI = 0x81
212
+ LANG_MARATHI = 0x4e
213
+ LANG_MONGOLIAN = 0x50
214
+ LANG_NEPALI = 0x61
215
+ LANG_NORWEGIAN = 0x14
216
+ LANG_ORIYA = 0x48
217
+ LANG_POLISH = 0x15
218
+ LANG_PORTUGUESE = 0x16
219
+ LANG_PUNJABI = 0x46
220
+ LANG_QUECHUA = 0x6b
221
+ LANG_ROMANIAN = 0x18
222
+ LANG_RUSSIAN = 0x19
223
+ LANG_SAMI = 0x3b
224
+ LANG_SANSKRIT = 0x4f
225
+ LANG_SERBIAN = 0x1a
226
+ LANG_SINDHI = 0x59
227
+ LANG_SLOVAK = 0x1b
228
+ LANG_SLOVENIAN = 0x24
229
+ LANG_SOTHO = 0x6c
230
+ LANG_SPANISH = 0x0a
231
+ LANG_SWAHILI = 0x41
232
+ LANG_SWEDISH = 0x1d
233
+ LANG_SYRIAC = 0x5a
234
+ LANG_TAMIL = 0x49
235
+ LANG_TATAR = 0x44
236
+ LANG_TELUGU = 0x4a
237
+ LANG_THAI = 0x1e
238
+ LANG_TSWANA = 0x32
239
+ LANG_TURKISH = 0x1f
240
+ LANG_UKRAINIAN = 0x22
241
+ LANG_URDU = 0x20
242
+ LANG_UZBEK = 0x43
243
+ LANG_VIETNAMESE = 0x2a
244
+ LANG_WELSH = 0x52
245
+ LANG_XHOSA = 0x34
246
+ LANG_ZULU = 0x35
247
+
248
+ SUBLANG_NEUTRAL = 0x00 # language neutral
249
+ SUBLANG_DEFAULT = 0x01 # user default
250
+ SUBLANG_SYS_DEFAULT = 0x02 # system default
251
+
252
+ SUBLANG_ARABIC_SAUDI_ARABIA = 0x01 # Arabic (Saudi Arabia)
253
+ SUBLANG_ARABIC_IRAQ = 0x02 # Arabic (Iraq)
254
+ SUBLANG_ARABIC_EGYPT = 0x03 # Arabic (Egypt)
255
+ SUBLANG_ARABIC_LIBYA = 0x04 # Arabic (Libya)
256
+ SUBLANG_ARABIC_ALGERIA = 0x05 # Arabic (Algeria)
257
+ SUBLANG_ARABIC_MOROCCO = 0x06 # Arabic (Morocco)
258
+ SUBLANG_ARABIC_TUNISIA = 0x07 # Arabic (Tunisia)
259
+ SUBLANG_ARABIC_OMAN = 0x08 # Arabic (Oman)
260
+ SUBLANG_ARABIC_YEMEN = 0x09 # Arabic (Yemen)
261
+ SUBLANG_ARABIC_SYRIA = 0x0a # Arabic (Syria)
262
+ SUBLANG_ARABIC_JORDAN = 0x0b # Arabic (Jordan)
263
+ SUBLANG_ARABIC_LEBANON = 0x0c # Arabic (Lebanon)
264
+ SUBLANG_ARABIC_KUWAIT = 0x0d # Arabic (Kuwait)
265
+ SUBLANG_ARABIC_UAE = 0x0e # Arabic (U.A.E)
266
+ SUBLANG_ARABIC_BAHRAIN = 0x0f # Arabic (Bahrain)
267
+ SUBLANG_ARABIC_QATAR = 0x10 # Arabic (Qatar)
268
+ SUBLANG_AZERI_LATIN = 0x01 # Azeri (Latin)
269
+ SUBLANG_AZERI_CYRILLIC = 0x02 # Azeri (Cyrillic)
270
+ SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN = 0x05 # Bosnian (Bosnia and Herzegovina - Latin)
271
+ SUBLANG_CHINESE_TRADITIONAL = 0x01 # Chinese (Taiwan)
272
+ SUBLANG_CHINESE_SIMPLIFIED = 0x02 # Chinese (PR China)
273
+ SUBLANG_CHINESE_HONGKONG = 0x03 # Chinese (Hong Kong S.A.R., P.R.C.)
274
+ SUBLANG_CHINESE_SINGAPORE = 0x04 # Chinese (Singapore)
275
+ SUBLANG_CHINESE_MACAU = 0x05 # Chinese (Macau S.A.R.)
276
+ SUBLANG_CROATIAN_CROATIA = 0x01 # Croatian (Croatia)
277
+ SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN = 0x04 # Croatian (Bosnia and Herzegovina - Latin)
278
+ SUBLANG_DUTCH = 0x01 # Dutch
279
+ SUBLANG_DUTCH_BELGIAN = 0x02 # Dutch (Belgian)
280
+ SUBLANG_ENGLISH_US = 0x01 # English (USA)
281
+ SUBLANG_ENGLISH_UK = 0x02 # English (UK)
282
+ SUBLANG_ENGLISH_AUS = 0x03 # English (Australian)
283
+ SUBLANG_ENGLISH_CAN = 0x04 # English (Canadian)
284
+ SUBLANG_ENGLISH_NZ = 0x05 # English (New Zealand)
285
+ SUBLANG_ENGLISH_EIRE = 0x06 # English (Irish)
286
+ SUBLANG_ENGLISH_SOUTH_AFRICA = 0x07 # English (South Africa)
287
+ SUBLANG_ENGLISH_JAMAICA = 0x08 # English (Jamaica)
288
+ SUBLANG_ENGLISH_CARIBBEAN = 0x09 # English (Caribbean)
289
+ SUBLANG_ENGLISH_BELIZE = 0x0a # English (Belize)
290
+ SUBLANG_ENGLISH_TRINIDAD = 0x0b # English (Trinidad)
291
+ SUBLANG_ENGLISH_ZIMBABWE = 0x0c # English (Zimbabwe)
292
+ SUBLANG_ENGLISH_PHILIPPINES = 0x0d # English (Philippines)
293
+ SUBLANG_FRENCH = 0x01 # French
294
+ SUBLANG_FRENCH_BELGIAN = 0x02 # French (Belgian)
295
+ SUBLANG_FRENCH_CANADIAN = 0x03 # French (Canadian)
296
+ SUBLANG_FRENCH_SWISS = 0x04 # French (Swiss)
297
+ SUBLANG_FRENCH_LUXEMBOURG = 0x05 # French (Luxembourg)
298
+ SUBLANG_FRENCH_MONACO = 0x06 # French (Monaco)
299
+ SUBLANG_GERMAN = 0x01 # German
300
+ SUBLANG_GERMAN_SWISS = 0x02 # German (Swiss)
301
+ SUBLANG_GERMAN_AUSTRIAN = 0x03 # German (Austrian)
302
+ SUBLANG_GERMAN_LUXEMBOURG = 0x04 # German (Luxembourg)
303
+ SUBLANG_GERMAN_LIECHTENSTEIN = 0x05 # German (Liechtenstein)
304
+ SUBLANG_ITALIAN = 0x01 # Italian
305
+ SUBLANG_ITALIAN_SWISS = 0x02 # Italian (Swiss)
306
+ SUBLANG_KASHMIRI_SASIA = 0x02 # Kashmiri (South Asia)
307
+ SUBLANG_KASHMIRI_INDIA = 0x02 # For app compatibility only
308
+ SUBLANG_KOREAN = 0x01 # Korean (Extended Wansung)
309
+ SUBLANG_LITHUANIAN = 0x01 # Lithuanian
310
+ SUBLANG_MALAY_MALAYSIA = 0x01 # Malay (Malaysia)
311
+ SUBLANG_MALAY_BRUNEI_DARUSSALAM = 0x02 # Malay (Brunei Darussalam)
312
+ SUBLANG_NEPALI_INDIA = 0x02 # Nepali (India)
313
+ SUBLANG_NORWEGIAN_BOKMAL = 0x01 # Norwegian (Bokmal)
314
+ SUBLANG_NORWEGIAN_NYNORSK = 0x02 # Norwegian (Nynorsk)
315
+ SUBLANG_PORTUGUESE = 0x02 # Portuguese
316
+ SUBLANG_PORTUGUESE_BRAZILIAN = 0x01 # Portuguese (Brazilian)
317
+ SUBLANG_QUECHUA_BOLIVIA = 0x01 # Quechua (Bolivia)
318
+ SUBLANG_QUECHUA_ECUADOR = 0x02 # Quechua (Ecuador)
319
+ SUBLANG_QUECHUA_PERU = 0x03 # Quechua (Peru)
320
+ SUBLANG_SAMI_NORTHERN_NORWAY = 0x01 # Northern Sami (Norway)
321
+ SUBLANG_SAMI_NORTHERN_SWEDEN = 0x02 # Northern Sami (Sweden)
322
+ SUBLANG_SAMI_NORTHERN_FINLAND = 0x03 # Northern Sami (Finland)
323
+ SUBLANG_SAMI_LULE_NORWAY = 0x04 # Lule Sami (Norway)
324
+ SUBLANG_SAMI_LULE_SWEDEN = 0x05 # Lule Sami (Sweden)
325
+ SUBLANG_SAMI_SOUTHERN_NORWAY = 0x06 # Southern Sami (Norway)
326
+ SUBLANG_SAMI_SOUTHERN_SWEDEN = 0x07 # Southern Sami (Sweden)
327
+ SUBLANG_SAMI_SKOLT_FINLAND = 0x08 # Skolt Sami (Finland)
328
+ SUBLANG_SAMI_INARI_FINLAND = 0x09 # Inari Sami (Finland)
329
+ SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN = 0x06 # Serbian (Bosnia and Herzegovina - Latin)
330
+ SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC = 0x07 # Serbian (Bosnia and Herzegovina - Cyrillic)
331
+ SUBLANG_SERBIAN_LATIN = 0x02 # Serbian (Latin)
332
+ SUBLANG_SERBIAN_CYRILLIC = 0x03 # Serbian (Cyrillic)
333
+ SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA = 0x01 # Northern Sotho (South Africa)
334
+ SUBLANG_SPANISH = 0x01 # Spanish (Castilian)
335
+ SUBLANG_SPANISH_MEXICAN = 0x02 # Spanish (Mexican)
336
+ SUBLANG_SPANISH_MODERN = 0x03 # Spanish (Modern)
337
+ SUBLANG_SPANISH_GUATEMALA = 0x04 # Spanish (Guatemala)
338
+ SUBLANG_SPANISH_COSTA_RICA = 0x05 # Spanish (Costa Rica)
339
+ SUBLANG_SPANISH_PANAMA = 0x06 # Spanish (Panama)
340
+ SUBLANG_SPANISH_DOMINICAN_REPUBLIC = 0x07 # Spanish (Dominican Republic)
341
+ SUBLANG_SPANISH_VENEZUELA = 0x08 # Spanish (Venezuela)
342
+ SUBLANG_SPANISH_COLOMBIA = 0x09 # Spanish (Colombia)
343
+ SUBLANG_SPANISH_PERU = 0x0a # Spanish (Peru)
344
+ SUBLANG_SPANISH_ARGENTINA = 0x0b # Spanish (Argentina)
345
+ SUBLANG_SPANISH_ECUADOR = 0x0c # Spanish (Ecuador)
346
+ SUBLANG_SPANISH_CHILE = 0x0d # Spanish (Chile)
347
+ SUBLANG_SPANISH_URUGUAY = 0x0e # Spanish (Uruguay)
348
+ SUBLANG_SPANISH_PARAGUAY = 0x0f # Spanish (Paraguay)
349
+ SUBLANG_SPANISH_BOLIVIA = 0x10 # Spanish (Bolivia)
350
+ SUBLANG_SPANISH_EL_SALVADOR = 0x11 # Spanish (El Salvador)
351
+ SUBLANG_SPANISH_HONDURAS = 0x12 # Spanish (Honduras)
352
+ SUBLANG_SPANISH_NICARAGUA = 0x13 # Spanish (Nicaragua)
353
+ SUBLANG_SPANISH_PUERTO_RICO = 0x14 # Spanish (Puerto Rico)
354
+ SUBLANG_SWEDISH = 0x01 # Swedish
355
+ SUBLANG_SWEDISH_FINLAND = 0x02 # Swedish (Finland)
356
+ SUBLANG_URDU_PAKISTAN = 0x01 # Urdu (Pakistan)
357
+ SUBLANG_URDU_INDIA = 0x02 # Urdu (India)
358
+ SUBLANG_UZBEK_LATIN = 0x01 # Uzbek (Latin)
359
+ SUBLANG_UZBEK_CYRILLIC = 0x02 # Uzbek (Cyrillic)
360
+
361
+ LOCALE_NOUSEROVERRIDE = 0x80000000
362
+ LOCALE_USE_CP_ACP = 0x40000000
363
+ LOCALE_RETURN_NUMBER = 0x20000000
364
+
365
+ LOCALE_ILANGUAGE = 0x00000001
366
+ LOCALE_SLANGUAGE = 0x00000002
367
+ LOCALE_SENGLANGUAGE = 0x00001001
368
+ LOCALE_SABBREVLANGNAME = 0x00000003
369
+ LOCALE_SNATIVELANGNAME = 0x00000004
370
+
371
+ LOCALE_ICOUNTRY = 0x00000005
372
+ LOCALE_SCOUNTRY = 0x00000006
373
+ LOCALE_SENGCOUNTRY = 0x00001002
374
+ LOCALE_SABBREVCTRYNAME = 0x00000007
375
+ LOCALE_SNATIVECTRYNAME = 0x00000008
376
+
377
+ LOCALE_IDEFAULTLANGUAGE = 0x00000009 # default language id
378
+ LOCALE_IDEFAULTCOUNTRY = 0x0000000A # default country code
379
+ LOCALE_IDEFAULTCODEPAGE = 0x0000000B # default oem code page
380
+ LOCALE_IDEFAULTANSICODEPAGE = 0x00001004 # default ansi code page
381
+ LOCALE_IDEFAULTMACCODEPAGE = 0x00001011 # default mac code page
382
+
383
+ LOCALE_SLIST = 0x0000000C # list item separator
384
+ LOCALE_IMEASURE = 0x0000000D # 0 = metric, 1 = US
385
+
386
+ LOCALE_SDECIMAL = 0x0000000E # decimal separator
387
+ LOCALE_STHOUSAND = 0x0000000F # thousand separator
388
+ LOCALE_SGROUPING = 0x00000010 # digit grouping
389
+ LOCALE_IDIGITS = 0x00000011 # number of fractional digits
390
+ LOCALE_ILZERO = 0x00000012 # leading zeros for decimal
391
+ LOCALE_INEGNUMBER = 0x00001010 # negative number mode
392
+ LOCALE_SNATIVEDIGITS = 0x00000013 # native ascii 0-9
393
+
394
+ LOCALE_SCURRENCY = 0x00000014 # local monetary symbol
395
+ LOCALE_SINTLSYMBOL = 0x00000015 # intl monetary symbol
396
+ LOCALE_SMONDECIMALSEP = 0x00000016 # monetary decimal separator
397
+ LOCALE_SMONTHOUSANDSEP = 0x00000017 # monetary thousand separator
398
+ LOCALE_SMONGROUPING = 0x00000018 # monetary grouping
399
+ LOCALE_ICURRDIGITS = 0x00000019 # # local monetary digits
400
+ LOCALE_IINTLCURRDIGITS = 0x0000001A # # intl monetary digits
401
+ LOCALE_ICURRENCY = 0x0000001B # positive currency mode
402
+ LOCALE_INEGCURR = 0x0000001C # negative currency mode
403
+
404
+ LOCALE_SDATE = 0x0000001D # date separator
405
+ LOCALE_STIME = 0x0000001E # time separator
406
+ LOCALE_SSHORTDATE = 0x0000001F # short date format string
407
+ LOCALE_SLONGDATE = 0x00000020 # long date format string
408
+ LOCALE_STIMEFORMAT = 0x00001003 # time format string
409
+ LOCALE_IDATE = 0x00000021 # short date format ordering
410
+ LOCALE_ILDATE = 0x00000022 # long date format ordering
411
+ LOCALE_ITIME = 0x00000023 # time format specifier
412
+ LOCALE_ITIMEMARKPOSN = 0x00001005 # time marker position
413
+ LOCALE_ICENTURY = 0x00000024 # century format specifier (short date)
414
+ LOCALE_ITLZERO = 0x00000025 # leading zeros in time field
415
+ LOCALE_IDAYLZERO = 0x00000026 # leading zeros in day field (short date)
416
+ LOCALE_IMONLZERO = 0x00000027 # leading zeros in month field (short date)
417
+ LOCALE_S1159 = 0x00000028 # AM designator
418
+ LOCALE_S2359 = 0x00000029 # PM designator
419
+
420
+ LOCALE_ICALENDARTYPE = 0x00001009 # type of calendar specifier
421
+ LOCALE_IOPTIONALCALENDAR = 0x0000100B # additional calendar types specifier
422
+ LOCALE_IFIRSTDAYOFWEEK = 0x0000100C # first day of week specifier
423
+ LOCALE_IFIRSTWEEKOFYEAR = 0x0000100D # first week of year specifier
424
+
425
+ LOCALE_SDAYNAME1 = 0x0000002A # long name for Monday
426
+ LOCALE_SDAYNAME2 = 0x0000002B # long name for Tuesday
427
+ LOCALE_SDAYNAME3 = 0x0000002C # long name for Wednesday
428
+ LOCALE_SDAYNAME4 = 0x0000002D # long name for Thursday
429
+ LOCALE_SDAYNAME5 = 0x0000002E # long name for Friday
430
+ LOCALE_SDAYNAME6 = 0x0000002F # long name for Saturday
431
+ LOCALE_SDAYNAME7 = 0x00000030 # long name for Sunday
432
+ LOCALE_SABBREVDAYNAME1 = 0x00000031 # abbreviated name for Monday
433
+ LOCALE_SABBREVDAYNAME2 = 0x00000032 # abbreviated name for Tuesday
434
+ LOCALE_SABBREVDAYNAME3 = 0x00000033 # abbreviated name for Wednesday
435
+ LOCALE_SABBREVDAYNAME4 = 0x00000034 # abbreviated name for Thursday
436
+ LOCALE_SABBREVDAYNAME5 = 0x00000035 # abbreviated name for Friday
437
+ LOCALE_SABBREVDAYNAME6 = 0x00000036 # abbreviated name for Saturday
438
+ LOCALE_SABBREVDAYNAME7 = 0x00000037 # abbreviated name for Sunday
439
+ LOCALE_SMONTHNAME1 = 0x00000038 # long name for January
440
+ LOCALE_SMONTHNAME2 = 0x00000039 # long name for February
441
+ LOCALE_SMONTHNAME3 = 0x0000003A # long name for March
442
+ LOCALE_SMONTHNAME4 = 0x0000003B # long name for April
443
+ LOCALE_SMONTHNAME5 = 0x0000003C # long name for May
444
+ LOCALE_SMONTHNAME6 = 0x0000003D # long name for June
445
+ LOCALE_SMONTHNAME7 = 0x0000003E # long name for July
446
+ LOCALE_SMONTHNAME8 = 0x0000003F # long name for August
447
+ LOCALE_SMONTHNAME9 = 0x00000040 # long name for September
448
+ LOCALE_SMONTHNAME10 = 0x00000041 # long name for October
449
+ LOCALE_SMONTHNAME11 = 0x00000042 # long name for November
450
+ LOCALE_SMONTHNAME12 = 0x00000043 # long name for December
451
+ LOCALE_SMONTHNAME13 = 0x0000100E # long name for 13th month (if exists)
452
+ LOCALE_SABBREVMONTHNAME1 = 0x00000044 # abbreviated name for January
453
+ LOCALE_SABBREVMONTHNAME2 = 0x00000045 # abbreviated name for February
454
+ LOCALE_SABBREVMONTHNAME3 = 0x00000046 # abbreviated name for March
455
+ LOCALE_SABBREVMONTHNAME4 = 0x00000047 # abbreviated name for April
456
+ LOCALE_SABBREVMONTHNAME5 = 0x00000048 # abbreviated name for May
457
+ LOCALE_SABBREVMONTHNAME6 = 0x00000049 # abbreviated name for June
458
+ LOCALE_SABBREVMONTHNAME7 = 0x0000004A # abbreviated name for July
459
+ LOCALE_SABBREVMONTHNAME8 = 0x0000004B # abbreviated name for August
460
+ LOCALE_SABBREVMONTHNAME9 = 0x0000004C # abbreviated name for September
461
+ LOCALE_SABBREVMONTHNAME10 = 0x0000004D # abbreviated name for October
462
+ LOCALE_SABBREVMONTHNAME11 = 0x0000004E # abbreviated name for November
463
+ LOCALE_SABBREVMONTHNAME12 = 0x0000004F # abbreviated name for December
464
+ LOCALE_SABBREVMONTHNAME13 = 0x0000100F # abbreviated name for 13th month (if exists)
465
+
466
+ LOCALE_SPOSITIVESIGN = 0x00000050 # positive sign
467
+ LOCALE_SNEGATIVESIGN = 0x00000051 # negative sign
468
+ LOCALE_IPOSSIGNPOSN = 0x00000052 # positive sign position
469
+ LOCALE_INEGSIGNPOSN = 0x00000053 # negative sign position
470
+ LOCALE_IPOSSYMPRECEDES = 0x00000054 # mon sym precedes pos amt
471
+ LOCALE_IPOSSEPBYSPACE = 0x00000055 # mon sym sep by space from pos amt
472
+ LOCALE_INEGSYMPRECEDES = 0x00000056 # mon sym precedes neg amt
473
+ LOCALE_INEGSEPBYSPACE = 0x00000057 # mon sym sep by space from neg amt
474
+
475
+ LOCALE_FONTSIGNATURE = 0x00000058 # font signature
476
+ LOCALE_SISO639LANGNAME = 0x00000059 # ISO abbreviated language name
477
+ LOCALE_SISO3166CTRYNAME = 0x0000005A # ISO abbreviated country name
478
+
479
+ LOCALE_IDEFAULTEBCDICCODEPAGE = 0x00001012 # default ebcdic code page
480
+ LOCALE_IPAPERSIZE = 0x0000100A # 1 = letter, 5 = legal, 8 = a3, 9 = a4
481
+ LOCALE_SENGCURRNAME = 0x00001007 # english name of currency
482
+ LOCALE_SNATIVECURRNAME = 0x00001008 # native name of currency
483
+ LOCALE_SYEARMONTH = 0x00001006 # year month format string
484
+ LOCALE_SSORTNAME = 0x00001013 # sort name
485
+ LOCALE_IDIGITSUBSTITUTION = 0x00001014 # 0 = context, 1 = none, 2 = national
486
+
487
+ TIME_NOMINUTESORSECONDS = 0x00000001 # do not use minutes or seconds
488
+ TIME_NOSECONDS = 0x00000002 # do not use seconds
489
+ TIME_NOTIMEMARKER = 0x00000004 # do not use time marker
490
+ TIME_FORCE24HOURFORMAT = 0x00000008 # always use 24 hour format
491
+
492
+ DATE_SHORTDATE = 0x00000001 # use short date picture
493
+ DATE_LONGDATE = 0x00000002 # use long date picture
494
+ DATE_USE_ALT_CALENDAR = 0x00000004 # use alternate calendar (if any)
495
+
496
+ DATE_YEARMONTH = 0x00000008 # use year month picture
497
+ DATE_LTRREADING = 0x00000010 # add marks for left to right reading order layout
498
+ DATE_RTLREADING = 0x00000020 # add marks for right to left reading order layout
499
+
500
+ SORT_DEFAULT = 0x0 # sorting default
501
+
502
+ SORT_JAPANESE_XJIS = 0x0 # Japanese XJIS order
503
+ SORT_JAPANESE_UNICODE = 0x1 # Japanese Unicode order
504
+
505
+ SORT_CHINESE_BIG5 = 0x0 # Chinese BIG5 order
506
+ SORT_CHINESE_PRCP = 0x0 # PRC Chinese Phonetic order
507
+ SORT_CHINESE_UNICODE = 0x1 # Chinese Unicode order
508
+ SORT_CHINESE_PRC = 0x2 # PRC Chinese Stroke Count order
509
+ SORT_CHINESE_BOPOMOFO = 0x3 # Traditional Chinese Bopomofo order
510
+
511
+ SORT_KOREAN_KSC = 0x0 # Korean KSC order
512
+ SORT_KOREAN_UNICODE = 0x1 # Korean Unicode order
513
+
514
+ SORT_GERMAN_PHONE_BOOK = 0x1 # German Phone Book order
515
+
516
+ SORT_HUNGARIAN_DEFAULT = 0x0 # Hungarian Default order
517
+ SORT_HUNGARIAN_TECHNICAL = 0x1 # Hungarian Technical order
518
+
519
+ SORT_GEORGIAN_TRADITIONAL = 0x0 # Georgian Traditional order
520
+ SORT_GEORGIAN_MODERN = 0x1 # Georgian Modern order
521
+
522
+ LANG_SYSTEM_DEFAULT = 2048
523
+ LANG_USER_DEFAULT = 1024
524
+ LOCALE_SYSTEM_DEFAULT = 2048
525
+ LOCALE_USER_DEFAULT = 1024
526
+
527
+ GetACP = Win32API.new('kernel32', 'GetACP', 'V', 'I')
528
+ GetDateFormat = Win32API.new('kernel32', 'GetDateFormat', 'LLPPPI', 'I')
529
+
530
+ def GetACP()
531
+ GetACP.call
532
+ end
533
+
534
+ def GetDateFormat(locale, flags, date, format, datestr, size)
535
+ GetDateFormat.call(locale, flags, date, format, datestr, size)
536
+ end
537
+
538
+ # Convenience method for converting the results of the GetACP()
539
+ # function to a human readable string.
540
+ #
541
+ def get_acp_string
542
+ CODE_PAGE[GetACP.call]
543
+ end
544
+
545
+ # Equivalent of the MAKELCID macro in WinNT.h
546
+ #
547
+ def MAKELCID(srtid, lgid)
548
+ srtid << 16 | lgid
549
+ end
550
+
551
+ # Equivalent of the MAKELANGID macro in WinNT.h
552
+ #
553
+ def MAKELANGID(p, s)
554
+ s << 10 | p
555
+ end
556
+ end
557
+ end