aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-03-16 13:59:03 +0200
committerEli Zaretskii2019-03-16 13:59:03 +0200
commit34dd4e0a83e19882f61c9a2ac99ecc12632d13d4 (patch)
tree4a75c1022d920bba69782097c90b22e03d4a8365
parent164b78c714dd5300cc1e6f630dc596856486b432 (diff)
downloademacs-34dd4e0a83e19882f61c9a2ac99ecc12632d13d4.tar.gz
emacs-34dd4e0a83e19882f61c9a2ac99ecc12632d13d4.zip
Improve locale and language environment setting at startup
* lisp/international/mule-cmds.el (locale-language-names): Add more locales and their language environments. (set-locale-environment): Use w32-multibyte-code-page, if non-zero, as locale-coding-system. (Bug#34684) * src/w32fns.c (globals_of_w32fns) <w32-multibyte-code-page>: New variable. * etc/NEWS: Mention w32-multibyte-code-page.
-rw-r--r--etc/NEWS8
-rw-r--r--lisp/international/mule-cmds.el111
-rw-r--r--src/w32fns.c10
3 files changed, 97 insertions, 32 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 000d211c1ab..f25c3f5dc3d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1736,6 +1736,14 @@ versions of MS-Windows. Set this variable to 50 if for some reason
1736you need the old behavior (and please report such situations to Emacs 1736you need the old behavior (and please report such situations to Emacs
1737developers). 1737developers).
1738 1738
1739---
1740** New variable 'w32-multibyte-code-page'.
1741This variable holds the value of the multibyte code page used by the
1742system. It is usually zero, which indicates that 'w32-ansi-code-page'
1743is being used, except in Far Eastern locales. When this variable is
1744non-zero, Emacs at startup sets 'locale-coding-system' to the
1745corresponding encoding, instead of using 'w32-ansi-code-page'.
1746
1739+++ 1747+++
1740** On NS the behaviour of drag and drop can now be modified by use of 1748** On NS the behaviour of drag and drop can now be modified by use of
1741modifier keys in line with Apples guidelines. This makes the drag and 1749modifier keys in line with Apples guidelines. This makes the drag and
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 3c1769a02fb..5f87d899415 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2181,22 +2181,27 @@ See `set-language-info-alist' for use in programs."
2181(defconst locale-language-names 2181(defconst locale-language-names
2182 (purecopy 2182 (purecopy
2183 '( 2183 '(
2184 ;; Locale names of the form LANGUAGE[_TERRITORY][.CODESET][@MODIFIER] 2184 ;; Locale names of the form LANGUAGE[_TERRITORY][.CODESET][@MODIFIER]
2185 ;; as specified in the Single Unix Spec, Version 2. 2185 ;; as specified in the Single Unix Spec, Version 2.
2186 ;; LANGUAGE is a language code taken from ISO 639:1988 (E/F) 2186 ;; LANGUAGE is a language code taken from ISO 639:1988 (E/F)
2187 ;; with additions from ISO 639/RA Newsletter No.1/1989; 2187 ;; with additions from ISO 639/RA Newsletter No.1/1989;
2188 ;; see Internet RFC 2165 (1997-06) and 2188 ;; see Internet RFC 2165 (1997-06) and
2189 ;; http://www.evertype.com/standards/iso639/iso639-en.html 2189 ;; http://www.evertype.com/standards/iso639/iso639-en.html
2190 ;; TERRITORY is a country code taken from ISO 3166 2190 ;; TERRITORY is a country code taken from ISO 3166
2191 ;; http://www.din.de/gremien/nas/nabd/iso3166ma/codlstp1/en_listp1.html. 2191 ;; http://www.din.de/gremien/nas/nabd/iso3166ma/codlstp1/en_listp1.html.
2192 ;; CODESET and MODIFIER are implementation-dependent. 2192 ;; CODESET and MODIFIER are implementation-dependent.
2193
2194 ;; Language names for which there are no locales (yet) are
2195 ;; commented out.
2193 2196
2194 ;; jasonr comments: MS Windows uses three letter codes for 2197 ;; jasonr comments: MS Windows uses three letter codes for
2195 ;; languages instead of the two letter ISO codes that POSIX 2198 ;; languages instead of the two letter ISO codes that POSIX
2196 ;; uses. In most cases the first two letters are the same, so 2199 ;; uses. In most cases the first two letters are the same, so
2197 ;; most of the regexps in locale-language-names work. Japanese 2200 ;; most of the regexps in locale-language-names work. Japanese,
2198 ;; and Chinese are exceptions, which are listed in the 2201 ;; Chinese, and some others are exceptions, which are listed in the
2199 ;; non-standard section at the bottom of locale-language-names. 2202 ;; non-standard section at the bottom of locale-language-names, or
2203 ;; in the main section, if otherwise we would pick up the wrong
2204 ;; entry (because the first matching entry is used).
2200 2205
2201 ("aa_DJ" . "Latin-1") ; Afar 2206 ("aa_DJ" . "Latin-1") ; Afar
2202 ("aa" . "UTF-8") 2207 ("aa" . "UTF-8")
@@ -2204,11 +2209,12 @@ See `set-language-info-alist' for use in programs."
2204 ("af" . "Latin-1") ; Afrikaans 2209 ("af" . "Latin-1") ; Afrikaans
2205 ("am" "Ethiopic" utf-8) ; Amharic 2210 ("am" "Ethiopic" utf-8) ; Amharic
2206 ("an" . "Latin-9") ; Aragonese 2211 ("an" . "Latin-9") ; Aragonese
2212 ("arn" . "UTF-8") ; MS-Windows Mapudungun, Mapuche
2207 ("ar" . "Arabic") 2213 ("ar" . "Arabic")
2208 ; as Assamese 2214 ("as" . "UTF-8") ; Assamese
2209 ; ay Aymara 2215 ; ay Aymara
2210 ("az" . "UTF-8") ; Azerbaijani 2216 ("az" . "UTF-8") ; Azerbaijani
2211 ; ba Bashkir 2217 ("ba" . "UTF-8") ; Bashkir, Cyrillic script
2212 ("be" "Belarusian" cp1251) ; Belarusian [Byelorussian until early 1990s] 2218 ("be" "Belarusian" cp1251) ; Belarusian [Byelorussian until early 1990s]
2213 ("bg" "Bulgarian" cp1251) ; Bulgarian 2219 ("bg" "Bulgarian" cp1251) ; Bulgarian
2214 ; bh Bihari 2220 ; bh Bihari
@@ -2219,12 +2225,12 @@ See `set-language-info-alist' for use in programs."
2219 ("bs" . "Latin-2") ; Bosnian 2225 ("bs" . "Latin-2") ; Bosnian
2220 ("byn" . "UTF-8") ; Bilin; Blin 2226 ("byn" . "UTF-8") ; Bilin; Blin
2221 ("ca" "Catalan" iso-8859-1) ; Catalan 2227 ("ca" "Catalan" iso-8859-1) ; Catalan
2222 ; co Corsican 2228 ("co" . "UTF-8") ; Corsican
2223 ("cs" "Czech" iso-8859-2) 2229 ("cs" "Czech" iso-8859-2)
2224 ("cy" "Welsh" iso-8859-14) 2230 ("cy" "Welsh" iso-8859-14)
2225 ("da" . "Latin-1") ; Danish 2231 ("da" . "Latin-1") ; Danish
2226 ("de" "German" iso-8859-1) 2232 ("de" "German" iso-8859-1)
2227 ; dv Divehi 2233 ("dv" . "UTF-8") ; Divehi
2228 ; dz Bhutani 2234 ; dz Bhutani
2229 ("ee" . "Latin-4") ; Ewe 2235 ("ee" . "Latin-4") ; Ewe
2230 ("el" "Greek" iso-8859-7) 2236 ("el" "Greek" iso-8859-7)
@@ -2238,6 +2244,8 @@ See `set-language-info-alist' for use in programs."
2238 ("et" . "Latin-9") ; Estonian 2244 ("et" . "Latin-9") ; Estonian
2239 ("eu" . "Latin-1") ; Basque 2245 ("eu" . "Latin-1") ; Basque
2240 ("fa" "Persian" utf-8) ; Persian 2246 ("fa" "Persian" utf-8) ; Persian
2247 ("fil" . "UTF-8") ; Filipino
2248 ("fpo" . "UTF-8") ; MS-Windows Filipino
2241 ("fi" . "Latin-9") ; Finnish 2249 ("fi" . "Latin-9") ; Finnish
2242 ("fj" . "Latin-1") ; Fiji 2250 ("fj" . "Latin-1") ; Fiji
2243 ("fo" . "Latin-1") ; Faroese 2251 ("fo" . "Latin-1") ; Faroese
@@ -2246,6 +2254,7 @@ See `set-language-info-alist' for use in programs."
2246 ("ga" . "Latin-1") ; Irish Gaelic (new orthography) 2254 ("ga" . "Latin-1") ; Irish Gaelic (new orthography)
2247 ("gd" . "Latin-9") ; Scots Gaelic 2255 ("gd" . "Latin-9") ; Scots Gaelic
2248 ("gez" "Ethiopic" utf-8) ; Geez 2256 ("gez" "Ethiopic" utf-8) ; Geez
2257 ("gla" . "Latin-9") ; MS-Windows Scots Gaelic
2249 ("gl" . "Latin-1") ; Gallegan; Galician 2258 ("gl" . "Latin-1") ; Gallegan; Galician
2250 ; gn Guarani 2259 ; gn Guarani
2251 ("gu" "Gujarati" utf-8) ; Gujarati 2260 ("gu" "Gujarati" utf-8) ; Gujarati
@@ -2256,27 +2265,33 @@ See `set-language-info-alist' for use in programs."
2256 ("hni_IN" . "UTF-8") ; Chhattisgarhi 2265 ("hni_IN" . "UTF-8") ; Chhattisgarhi
2257 ("hr" "Croatian" iso-8859-2) ; Croatian 2266 ("hr" "Croatian" iso-8859-2) ; Croatian
2258 ("hu" . "Latin-2") ; Hungarian 2267 ("hu" . "Latin-2") ; Hungarian
2259 ; hy Armenian 2268 ("hy" . "UTF-8") ; Armenian
2260 ; ia Interlingua 2269 ; ia Interlingua
2261 ("id" . "Latin-1") ; Indonesian 2270 ("id" . "Latin-1") ; Indonesian
2262 ; ie Interlingue 2271 ; ie Interlingue
2263 ; ik Inupiak 2272 ("ig" . "UTF-8") ; Igbo (Nigeria)
2273 ("ibo" . "UTF-8") ; MS-Windows Igbo
2274 ; ik Inupiak, Inupiaq
2264 ("is" . "Latin-1") ; Icelandic 2275 ("is" . "Latin-1") ; Icelandic
2265 ("it" "Italian" iso-8859-1) ; Italian 2276 ("it" "Italian" iso-8859-1) ; Italian
2266 ; iu Inuktitut 2277 ; iu Inuktitut
2267 ("iw" "Hebrew" iso-8859-8) 2278 ("iw" "Hebrew" iso-8859-8)
2268 ("ja" "Japanese" euc-jp) 2279 ("ja" "Japanese" euc-jp)
2269 ; jw Javanese 2280 ; jw Javanese
2281 ("kal" . "Latin-1") ; MS-Windows Greenlandic
2270 ("ka" "Georgian" georgian-ps) ; Georgian 2282 ("ka" "Georgian" georgian-ps) ; Georgian
2271 ; kk Kazakh 2283 ("kk" . "UTF-8") ; Kazakh
2272 ("kl" . "Latin-1") ; Greenlandic 2284 ("kl" . "Latin-1") ; Greenlandic
2273 ("km" "Khmer" utf-8) ; Cambodian, Khmer 2285 ("km" "Khmer" utf-8) ; Cambodian, Khmer
2286 ("knk" "Devanagari" utf-8) ; MS-Windows Konkani
2287 ("kok" "Devanagari" utf-8) ; Konkani
2274 ("kn" "Kannada" utf-8) 2288 ("kn" "Kannada" utf-8)
2275 ("ko" "Korean" euc-kr) 2289 ("ko" "Korean" euc-kr)
2276 ("ks" . "UTF-8") ; Kashmiri 2290 ("ks" . "UTF-8") ; Kashmiri
2277 ; ku Kurdish 2291 ; ku Kurdish
2278 ("kw" . "Latin-1") ; Cornish 2292 ("kw" . "Latin-1") ; Cornish
2279 ("ky" . "UTF-8") ; Kirghiz 2293 ("ky" . "UTF-8") ; Kirghiz
2294 ("lao" "Lao" utf-8) ; MS-Windows Lao
2280 ("la" . "Latin-1") ; Latin 2295 ("la" . "Latin-1") ; Latin
2281 ("lb" . "Latin-1") ; Luxemburgish 2296 ("lb" . "Latin-1") ; Luxemburgish
2282 ("lg" . "Latin-6") ; Ganda, a.k.a. Luganda 2297 ("lg" . "Latin-6") ; Ganda, a.k.a. Luganda
@@ -2287,18 +2302,22 @@ See `set-language-info-alist' for use in programs."
2287 ; mg Malagasy 2302 ; mg Malagasy
2288 ("mi" . "Latin-7") ; Maori 2303 ("mi" . "Latin-7") ; Maori
2289 ("mk" "Cyrillic-ISO" iso-8859-5) ; Macedonian 2304 ("mk" "Cyrillic-ISO" iso-8859-5) ; Macedonian
2305 ("mlt" . "Latin-3") ; MS-Windows Maltese
2290 ("ml" "Malayalam" utf-8) 2306 ("ml" "Malayalam" utf-8)
2291 ("mn" . "UTF-8") ; Mongolian 2307 ("mn" . "UTF-8") ; Mongolian
2292 ; mo Moldavian 2308 ; mo Moldavian (retired)
2309 ("mri" . "Latin-7") ; MS-Windows Maori
2293 ("mr" "Devanagari" utf-8) ; Marathi 2310 ("mr" "Devanagari" utf-8) ; Marathi
2294 ("ms" . "Latin-1") ; Malay 2311 ("ms" . "Latin-1") ; Malay
2295 ("mt" . "Latin-3") ; Maltese 2312 ("mt" . "Latin-3") ; Maltese
2313 ("mym" "Malayalam" utf-8) ; MS-Windows Malayalam
2296 ("my" "Burmese" utf-8) ; Burmese 2314 ("my" "Burmese" utf-8) ; Burmese
2297 ; na Nauru 2315 ; na Nauru
2298 ("nb" . "Latin-1") ; Norwegian 2316 ("nb" . "Latin-1") ; Norwegian
2299 ("ne" "Devanagari" utf-8) ; Nepali 2317 ("ne" "Devanagari" utf-8) ; Nepali
2300 ("nl" "Dutch" iso-8859-1) 2318 ("nl" "Dutch" iso-8859-1)
2301 ("nn" . "Latin-1") ; Norwegian Nynorsk 2319 ("nn" . "Latin-1") ; Norwegian Nynorsk
2320 ("non" . "Latin-1") ; MS-Windows Norwegian Nynorsk
2302 ("no" . "Latin-1") ; Norwegian 2321 ("no" . "Latin-1") ; Norwegian
2303 ("nr_ZA" . "UTF-8") ; South Ndebele 2322 ("nr_ZA" . "UTF-8") ; South Ndebele
2304 ("nso_ZA" . "UTF-8") ; Pedi 2323 ("nso_ZA" . "UTF-8") ; Pedi
@@ -2308,7 +2327,8 @@ See `set-language-info-alist' for use in programs."
2308 ("or" "Oriya" utf-8) 2327 ("or" "Oriya" utf-8)
2309 ("pa" "Punjabi" utf-8) ; Punjabi 2328 ("pa" "Punjabi" utf-8) ; Punjabi
2310 ("pl" "Polish" iso-8859-2) ; Polish 2329 ("pl" "Polish" iso-8859-2) ; Polish
2311 ; ps Pashto, Pushto 2330 ("ps" . "UTF-8") ; Pashto, Pushto
2331 ("pas" . "UTF-8") ; MS-Windows Pashto
2312 ("pt_BR" "Brazilian Portuguese" iso-8859-1) ; Brazilian Portuguese 2332 ("pt_BR" "Brazilian Portuguese" iso-8859-1) ; Brazilian Portuguese
2313 ("pt" . "Latin-1") ; Portuguese 2333 ("pt" . "Latin-1") ; Portuguese
2314 ; qu Quechua 2334 ; qu Quechua
@@ -2318,7 +2338,7 @@ See `set-language-info-alist' for use in programs."
2318 ("ru_RU.koi8r" "Cyrillic-KOI8" koi8-r) 2338 ("ru_RU.koi8r" "Cyrillic-KOI8" koi8-r)
2319 ("ru_RU" "Russian" iso-8859-5) 2339 ("ru_RU" "Russian" iso-8859-5)
2320 ("ru_UA" "Russian" koi8-u) 2340 ("ru_UA" "Russian" koi8-u)
2321 ; rw Kinyarwanda 2341 ("rw" . "UTF-8") ; Kinyarwanda
2322 ("sa" . "Devanagari") ; Sanskrit 2342 ("sa" . "Devanagari") ; Sanskrit
2323 ; sd Sindhi 2343 ; sd Sindhi
2324 ("se" . "UTF-8") ; Northern Sami 2344 ("se" . "UTF-8") ; Northern Sami
@@ -2339,6 +2359,7 @@ See `set-language-info-alist' for use in programs."
2339 ; su Sundanese 2359 ; su Sundanese
2340 ("sv" "Swedish" iso-8859-1) ; Swedish 2360 ("sv" "Swedish" iso-8859-1) ; Swedish
2341 ("sw" . "Latin-1") ; Swahili 2361 ("sw" . "Latin-1") ; Swahili
2362 ("taj" "Tajik" koi8-t) ; MS-Windows Tajik w/Cyrillic script
2342 ("ta" "Tamil" utf-8) 2363 ("ta" "Tamil" utf-8)
2343 ("te" "Telugu" utf-8) ; Telugu 2364 ("te" "Telugu" utf-8) ; Telugu
2344 ("tg" "Tajik" koi8-t) 2365 ("tg" "Tajik" koi8-t)
@@ -2348,15 +2369,17 @@ See `set-language-info-alist' for use in programs."
2348 ("th" "Thai" iso-8859-11) 2369 ("th" "Thai" iso-8859-11)
2349 ("ti" "Ethiopic" utf-8) ; Tigrinya 2370 ("ti" "Ethiopic" utf-8) ; Tigrinya
2350 ("tig_ER" . "UTF-8") ; Tigre 2371 ("tig_ER" . "UTF-8") ; Tigre
2351 ; tk Turkmen 2372 ("tk" . "Latin-5") ; Turkmen
2373 ("tuk" . "Latin-5") ; MS-Windows Turkmen
2352 ("tl" . "Latin-1") ; Tagalog 2374 ("tl" . "Latin-1") ; Tagalog
2353 ("tn" . "Latin-9") ; Setswana, Tswana 2375 ("tn" . "Latin-9") ; Setswana, Tswana
2354 ; to Tonga 2376 ; to Tonga
2355 ("tr" "Turkish" iso-8859-9) 2377 ("tr" "Turkish" iso-8859-9)
2378 ("tsn" . "Latin-9") ; MS-Windows Tswana
2356 ("ts" . "Latin-1") ; Tsonga 2379 ("ts" . "Latin-1") ; Tsonga
2357 ("tt" . "UTF-8") ; Tatar 2380 ("tt" . "UTF-8") ; Tatar
2358 ; tw Twi 2381 ; tw Twi
2359 ; ug Uighur 2382 ("ug" . "UTF-8") ; Uighur
2360 ("uk" "Ukrainian" koi8-u) 2383 ("uk" "Ukrainian" koi8-u)
2361 ("ur" . "UTF-8") ; Urdu 2384 ("ur" . "UTF-8") ; Urdu
2362 ("uz_UZ@cyrillic" . "UTF-8"); Uzbek 2385 ("uz_UZ@cyrillic" . "UTF-8"); Uzbek
@@ -2365,10 +2388,10 @@ See `set-language-info-alist' for use in programs."
2365 ("vi" "Vietnamese" utf-8) 2388 ("vi" "Vietnamese" utf-8)
2366 ; vo Volapuk 2389 ; vo Volapuk
2367 ("wa" . "Latin-1") ; Walloon 2390 ("wa" . "Latin-1") ; Walloon
2368 ; wo Wolof 2391 ("wo" . "UTF-8") ; Wolof
2369 ("xh" . "Latin-1") ; Xhosa 2392 ("xh" . "Latin-1") ; Xhosa
2370 ("yi" . "Windows-1255") ; Yiddish 2393 ("yi" . "Windows-1255") ; Yiddish
2371 ; yo Yoruba 2394 ("yo" . "UTF-8") ; Yoruba
2372 ; za Zhuang 2395 ; za Zhuang
2373 ("zh_HK" . "Chinese-Big5") 2396 ("zh_HK" . "Chinese-Big5")
2374 ; zh_HK/BIG5-HKSCS \ 2397 ; zh_HK/BIG5-HKSCS \
@@ -2378,6 +2401,9 @@ See `set-language-info-alist' for use in programs."
2378 ("zh_CN.GB18030" "Chinese-GB18030") 2401 ("zh_CN.GB18030" "Chinese-GB18030")
2379 ("zh_CN.UTF-8" . "Chinese-GBK") 2402 ("zh_CN.UTF-8" . "Chinese-GBK")
2380 ("zh_CN" . "Chinese-GB") 2403 ("zh_CN" . "Chinese-GB")
2404 ("zhh" . "Chinese-Big5") ; MS-Windows Chinese (Hong Kong S.A.R.)
2405 ("zhi" . "Chinese-GBK") ; MS-Windows Chinese (Singapore)
2406 ("zhm" . "Chinese-Big5") ; MS-Windows Chinese (Macao S.A.R.)
2381 ("zh" . "Chinese-GB") 2407 ("zh" . "Chinese-GB")
2382 ("zu" . "Latin-1") ; Zulu 2408 ("zu" . "Latin-1") ; Zulu
2383 2409
@@ -2395,12 +2421,23 @@ See `set-language-info-alist' for use in programs."
2395 ("sp" . "Cyrillic-ISO") ; Serbian (Cyrillic alphabet), e.g. X11R6.4 2421 ("sp" . "Cyrillic-ISO") ; Serbian (Cyrillic alphabet), e.g. X11R6.4
2396 ("su" . "Latin-1") ; Finnish, e.g. Solaris 2.6 2422 ("su" . "Latin-1") ; Finnish, e.g. Solaris 2.6
2397 ("jp" . "Japanese") ; e.g. MS Windows 2423 ("jp" . "Japanese") ; e.g. MS Windows
2398 ("chs" . "Chinese-GBK") ; MS Windows Chinese Simplified 2424 ("chs" . "Chinese-GBK") ; MS Windows Chinese Simplified (PRC)
2399 ("cht" . "Chinese-BIG5") ; MS Windows Chinese Traditional 2425 ("cht" . "Chinese-BIG5") ; MS Windows Chinese Traditional (Taiwan)
2400 ("gbz" . "UTF-8") ; MS Windows Dari Persian 2426 ("gbz" . "UTF-8") ; MS Windows Dari Persian
2401 ("div" . "UTF-8") ; MS Windows Divehi (Maldives) 2427 ("div" . "UTF-8") ; MS Windows Divehi (Maldives)
2402 ("wee" . "Latin-2") ; MS Windows Lower Sorbian 2428 ("wee" . "Latin-2") ; MS Windows Lower Sorbian
2403 ("wen" . "Latin-2") ; MS Windows Upper Sorbian 2429 ("wen" . "Latin-2") ; MS Windows Upper Sorbian
2430 ("ind" . "Latin-1") ; MS-Windows Indonesian
2431 ("sme" . "UTF-8") ; MS-Windows Northern Sami (Norway)
2432 ("smf" . "UTF-8") ; MS-Windows Northern Sami (Sweden)
2433 ("smg" . "ITF-8") ; MS-Windows Northern Sami (Finland)
2434 ("kdi" "Kannada" utf-8) ; MS-Windows Kannada
2435 ("mar" "Devanagari" utf-8) ; MS-Windows Marathi
2436 ("khm" "Khmer" utf-8) ; MS-Windows Khmer
2437 ("iri" . "Latin-1") ; MS-Windows Irish Gaelic
2438 ; mwk MS-Windows Mohawk (Canada)
2439 ("uig" . "UTF-8") ; MS-Windows Uighur
2440 ("kin" . "UTF-8") ; MS-Windows Kinyarwanda
2404 )) 2441 ))
2405 "Alist of locale regexps vs the corresponding languages and coding systems. 2442 "Alist of locale regexps vs the corresponding languages and coding systems.
2406Each element has this form: 2443Each element has this form:
@@ -2702,10 +2739,20 @@ See also `locale-charset-language-names', `locale-language-names',
2702 (output-coding 2739 (output-coding
2703 (if noninteractive 2740 (if noninteractive
2704 (intern (format "cp%d" (w32-get-console-output-codepage))) 2741 (intern (format "cp%d" (w32-get-console-output-codepage)))
2705 code-page-coding))) 2742 code-page-coding))
2706 (when (coding-system-p code-page-coding) 2743 (multibyte-code-page-coding
2744 (or (and (boundp 'w32-multibyte-code-page)
2745 (not (zerop w32-multibyte-code-page))
2746 (intern (format "cp%d" w32-multibyte-code-page)))
2747 code-page-coding))
2748 (locale-coding
2749 (if noninteractive
2750 code-page-coding
2751 multibyte-code-page-coding)))
2752 (when (and (coding-system-p code-page-coding)
2753 (coding-system-p locale-coding))
2707 (or output-coding (setq output-coding code-page-coding)) 2754 (or output-coding (setq output-coding code-page-coding))
2708 (unless frame (setq locale-coding-system code-page-coding)) 2755 (unless frame (setq locale-coding-system locale-coding))
2709 (set-keyboard-coding-system code-page-coding frame) 2756 (set-keyboard-coding-system code-page-coding frame)
2710 (set-terminal-coding-system output-coding frame) 2757 (set-terminal-coding-system output-coding frame)
2711 (setq default-file-name-coding-system ansi-code-page-coding)))) 2758 (setq default-file-name-coding-system ansi-code-page-coding))))
diff --git a/src/w32fns.c b/src/w32fns.c
index 4f53d93d8b4..1fbf32760dd 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -48,6 +48,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
48 48
49#ifdef WINDOWSNT 49#ifdef WINDOWSNT
50#include <mbstring.h> 50#include <mbstring.h>
51#include <mbctype.h> /* for _getmbcp */
51#endif /* WINDOWSNT */ 52#endif /* WINDOWSNT */
52 53
53#if CYGWIN 54#if CYGWIN
@@ -10908,6 +10909,15 @@ globals_of_w32fns (void)
10908 doc: /* The ANSI code page used by the system. */); 10909 doc: /* The ANSI code page used by the system. */);
10909 w32_ansi_code_page = GetACP (); 10910 w32_ansi_code_page = GetACP ();
10910 10911
10912#ifndef CYGWIN
10913 DEFVAR_INT ("w32-multibyte-code-page",
10914 w32_multibyte_code_page,
10915 doc: /* The current multibyte code page used by the system.
10916A value of zero indicates that the single-byte code page is in use,
10917see `w32-ansi-code-page'. */);
10918 w32_multibyte_code_page = _getmbcp ();
10919#endif
10920
10911 if (os_subtype == OS_NT) 10921 if (os_subtype == OS_NT)
10912 w32_unicode_gui = 1; 10922 w32_unicode_gui = 1;
10913 else 10923 else