Subject: Re: bug#79296: 30.2; format-time-string returns wrongly encoded string in MS Windows Japanese with cp65001 beta config

From: Eli Zaretskii <[email-masked]>
Date: Sat, 30 Aug 2025 12:25:09 +0300

> Date: Wed, 27 Aug 2025 22:54:30 +0900
> From: Shingo Tanaka <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,
> 	[email-masked],
> 	[email-masked],
> 	[email-masked],
> 	[email-masked]
> 
> On Wed, 27 Aug 2025 18:05:42 +0900,
> Bruno Haible wrote:
> > 
> > For producing such binaries with only Free Software (no MSVC compiler,
> > no MSVC header files) one can use MSYS2. For a year or two already
> > it supports two target environments:
> >   - mingw-w64 with MSVCRT,
> >   - mingw-w64 with UCRT.
> > These two development environments are very similar, which means that
> > the Makefile will need very few adapations.
> 
> I've just installed MSYS2 Emacs of UCRT version and run it with no init file. 
> 
> ~> pacman -S mingw-w64-ucrt-x86_64-emacs
> ~> /ucrt64/bin/runemacs --no-init-file
> 
> And confirmed the issue I reported doesn't happen even with
> "Beta: Use Unicode UTF-8 for worldwide language support" on.
> 
> In *scratch* buffer:
> 
> (format-time-string "%y,%d,%m %A" (date-to-time (concat "2025,1,Jan")))
> "25,01,01 水曜日"
> 
> w32-system-coding-system
> cp65001
> 
> w32-multibyte-code-page
> 0
> 
> w32-ansi-code-page
> 65001
> 
> (w32-get-current-locale-id)
> 1041
> 
> (w32-get-locale-info (w32-get-current-locale-id))
> "JPN"
> 
> (w32-get-default-locale-id)
> 1041
> 
> (w32-get-locale-info (w32-get-default-locale-id))
> "JPN"
> 
> (w32-get-console-codepage)
> 65001
> 
> (w32-get-console-output-codepage)
> 65001

Thanks.  I've now added a new section to the Emacs w32 FAQ about these
issues, and I'm therefore closing this bug.