> Date: Fri, 16 Jan 2026 21:50:36 +0100
> From: Patrice Dumas <[email protected]>
> Cc: [email protected], [email protected]
> 
> On Fri, Jan 16, 2026 at 10:24:19PM +0200, Eli Zaretskii wrote:
> > > In C, yes, therefore I can do the code in C, but in Perl, the GetACP()
> > > and GetConsoleOutputCP() obtained through Win32::API::More->Import call
> > > returns a string, and I would need to know what this string is gonna be
> > > for UTF-8.  I couldn't find that information on the internet.
> > 
> > I would expect the string to be the same in both cases: "65001" or
> > maybe "CP65001".
> > 
> > If you send me a short Perl program, I can tell you what it produces
> > on my Windows system.  Then we can be sure.
> 
> Here it is.  I couldn't really test it.

Thanks.  It returns the string representation of the codepage number:

  d:\usr\eli\utils\>chcp
  Active code page: 437

  d:\usr\eli\utils>perl ./print_CP.pl
  GetACP: '1252'
  GetConsoleOutputCP: '437'

  d:\usr\eli\utils\>chcp 65001
  Active code page: 65001

  d:\usr\eli\utils>perl ./print_CP.pl
  GetACP: '1252'
  GetConsoleOutputCP: '65001'

(The 'chcp' command displays or changes the console codepage.)

And yes, the system-wide codepage on this machine is 1252.  And
codepage 65001 is the UTF-8 codepage.

Reply via email to