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.

-- 
Pat
#! /usr/bin/env perl

use strict;

use Win32::API;

Win32::API::More->Import("kernel32", "int GetACP()");
Win32::API::More->Import("kernel32", "int GetConsoleOutputCP()");

my $CP = GetACP();
if (defined($CP)) {
  print "GetACP: '$CP'\n";
}

my $ConsoleCP = GetConsoleOutputCP();
if (defined($ConsoleCP)) {
  print "GetConsoleOutputCP: '$ConsoleCP'\n";
}

Reply via email to