mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
w32: Always use Unicode for console input and output.
* common/init.c (_init_common_subsystems) [W32]: Set the codepage to UTF-8 for input and putput. Switch gettext to UTF-8. * tools/gpgconf.c (main): Display the input and output codepage if they differ. * g10/gpg.c (utf8_strings) [W32]: Make sure this is always set. -- With this patch the former patch to use ReadConsoleW and WriteConsoleW in ttyio.c are kind of superfluous because the ANSI version of these functions are also able to read/write UTF-8 directly given the console code page has been set correctly. However, this seems to work only with recent versions of Windows-10. GnuPG-bug-id: 4365
This commit is contained in:
parent
31b708e268
commit
8c41b8aac3
4 changed files with 41 additions and 9 deletions
|
@ -945,7 +945,11 @@ main (int argc, char **argv)
|
|||
#ifdef HAVE_W32_SYSTEM
|
||||
{
|
||||
get_outfp (&outfp);
|
||||
es_fprintf (outfp, "Console: CP%u\n", GetConsoleOutputCP ());
|
||||
if (GetConsoleCP () != GetConsoleOutputCP ())
|
||||
es_fprintf (outfp, "Console: CP%u/CP%u\n",
|
||||
GetConsoleCP (), GetConsoleOutputCP ());
|
||||
else
|
||||
es_fprintf (outfp, "Console: CP%u\n", GetConsoleCP ());
|
||||
es_fprintf (outfp, "ANSI: CP%u\n", GetACP ());
|
||||
es_fprintf (outfp, "OEM: CP%u\n", GetOEMCP ());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue