summaryrefslogtreecommitdiff
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-03-16 13:59:03 +0200
committerEli Zaretskii <eliz@gnu.org>2019-03-16 13:59:03 +0200
commit34dd4e0a83e19882f61c9a2ac99ecc12632d13d4 (patch)
tree4a75c1022d920bba69782097c90b22e03d4a8365 /src/w32fns.c
parent164b78c714dd5300cc1e6f630dc596856486b432 (diff)
downloademacs-34dd4e0a83e19882f61c9a2ac99ecc12632d13d4.tar.gz
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.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c10
1 files changed, 10 insertions, 0 deletions
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/>. */
#ifdef WINDOWSNT
#include <mbstring.h>
+#include <mbctype.h> /* for _getmbcp */
#endif /* WINDOWSNT */
#if CYGWIN
@@ -10908,6 +10909,15 @@ globals_of_w32fns (void)
doc: /* The ANSI code page used by the system. */);
w32_ansi_code_page = GetACP ();
+#ifndef CYGWIN
+ DEFVAR_INT ("w32-multibyte-code-page",
+ w32_multibyte_code_page,
+ doc: /* The current multibyte code page used by the system.
+A value of zero indicates that the single-byte code page is in use,
+see `w32-ansi-code-page'. */);
+ w32_multibyte_code_page = _getmbcp ();
+#endif
+
if (os_subtype == OS_NT)
w32_unicode_gui = 1;
else