diff options
| author | Eli Zaretskii | 2025-01-05 07:56:27 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2025-01-05 07:56:27 +0200 |
| commit | cc5cd4de93d1e5ba205cbf0c370aef4559bc342b (patch) | |
| tree | 71acec11c587e517a2a15da1247b284bc1dcf3a8 /src | |
| parent | 441788e06d87c8cbd5efc9f2e00ba9072a824c55 (diff) | |
| download | emacs-cc5cd4de93d1e5ba205cbf0c370aef4559bc342b.tar.gz emacs-cc5cd4de93d1e5ba205cbf0c370aef4559bc342b.zip | |
Fix setup of coding-systems on MS-Windows
* src/emacs.c (main) [HAVE_PDUMPER] [WINDOWSNT]: Call
'w32_init_file_name_codepage' again after loading the pdumper
file.
* src/w32.c (w32_init_file_name_codepage) [HAVE_PDUMPER]:
Reinitialize additional variables. (Bug#75207)
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs.c | 13 | ||||
| -rw-r--r-- | src/w32.c | 13 |
2 files changed, 25 insertions, 1 deletions
diff --git a/src/emacs.c b/src/emacs.c index c1e0c9f3a57..896f219baab 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1419,7 +1419,18 @@ android_emacs_init (int argc, char **argv, char *dump_file) | |||
| 1419 | 1419 | ||
| 1420 | #ifdef HAVE_PDUMPER | 1420 | #ifdef HAVE_PDUMPER |
| 1421 | if (attempt_load_pdump) | 1421 | if (attempt_load_pdump) |
| 1422 | initial_emacs_executable = load_pdump (argc, argv, dump_file); | 1422 | { |
| 1423 | initial_emacs_executable = load_pdump (argc, argv, dump_file); | ||
| 1424 | #ifdef WINDOWSNT | ||
| 1425 | /* Reinitialize the codepage for file names, needed to decode | ||
| 1426 | non-ASCII file names during startup. This is needed because | ||
| 1427 | loading the pdumper file above assigns to those variables values | ||
| 1428 | from the dump stage, which might be incorrect, if dumping was done | ||
| 1429 | on a different system. */ | ||
| 1430 | if (dumped_with_pdumper_p ()) | ||
| 1431 | w32_init_file_name_codepage (); | ||
| 1432 | #endif | ||
| 1433 | } | ||
| 1423 | #else | 1434 | #else |
| 1424 | ptrdiff_t bufsize; | 1435 | ptrdiff_t bufsize; |
| 1425 | initial_emacs_executable = find_emacs_executable (argv[0], &bufsize); | 1436 | initial_emacs_executable = find_emacs_executable (argv[0], &bufsize); |
| @@ -1685,6 +1685,19 @@ w32_init_file_name_codepage (void) | |||
| 1685 | { | 1685 | { |
| 1686 | file_name_codepage = CP_ACP; | 1686 | file_name_codepage = CP_ACP; |
| 1687 | w32_ansi_code_page = CP_ACP; | 1687 | w32_ansi_code_page = CP_ACP; |
| 1688 | #ifdef HAVE_PDUMPER | ||
| 1689 | /* If we were dumped with pdumper, this function will be called after | ||
| 1690 | loading the pdumper file, and needs to reset the following | ||
| 1691 | variables that come from the dump stage, which could be on a | ||
| 1692 | different system with different default codepages. Then, the | ||
| 1693 | correct value of w32-ansi-code-page will be assigned by | ||
| 1694 | globals_of_w32fns, which is called from 'main'. Until that call | ||
| 1695 | happens, w32-ansi-code-page will have the value of CP_ACP, which | ||
| 1696 | stands for the default ANSI codepage. The other variables will be | ||
| 1697 | computed by codepage_for_filenames below. */ | ||
| 1698 | Vdefault_file_name_coding_system = Qnil; | ||
| 1699 | Vfile_name_coding_system = Qnil; | ||
| 1700 | #endif | ||
| 1688 | } | 1701 | } |
| 1689 | 1702 | ||
| 1690 | /* Produce a Windows ANSI codepage suitable for encoding file names. | 1703 | /* Produce a Windows ANSI codepage suitable for encoding file names. |