> Date: Sat, 18 Jan 2025 13:35:38 +0100 > From: Patrice Dumas <[email protected]> > Cc: [email protected] > > On Sat, Jan 18, 2025 at 02:18:14PM +0200, Eli Zaretskii wrote: > > > Date: Sat, 18 Jan 2025 12:11:13 +0100 > > > From: Patrice Dumas <[email protected]> > > > Cc: Eli Zaretskii <[email protected]> > > > > > The header is <windows.h>. You don't need to load kernel32.dll or > > import GetACP, as this will be taken care of when the program is > > linked on Windows. The code is > > > > char locale_encoding[8]; > > unsigned cp = GetACP (); > > > > locale_encoding = sprintf (locale_encoding, "cp%u", cp); > > > > (I don't know what does "if (defined($CP))" part do in Perl.) > > It is a failsafe in case $CP could be undefined, looks like this is not > possible in the C function.
It is also not needed in C, since GetACP will always yield a codepage number.
