aboutsummaryrefslogtreecommitdiffstats
path: root/g10/gpg.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2021-03-05 14:33:40 +0000
committerWerner Koch <[email protected]>2021-03-05 14:33:40 +0000
commit8c41b8aac3efb78178fe1eaf52d8d1bbc44941a8 (patch)
tree8e2a964084519e4ff4864643573d1d41ebec0e66 /g10/gpg.c
parentw32: Free memory allocated by new function w32_write_console. (diff)
downloadgnupg-8c41b8aac3efb78178fe1eaf52d8d1bbc44941a8.tar.gz
gnupg-8c41b8aac3efb78178fe1eaf52d8d1bbc44941a8.zip
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
Diffstat (limited to 'g10/gpg.c')
-rw-r--r--g10/gpg.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/g10/gpg.c b/g10/gpg.c
index 8e19a89f3..c61f17188 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -1007,7 +1007,13 @@ static struct debug_flags_s debug_flags [] =
int g10_errors_seen = 0;
-static int utf8_strings = 0;
+static int utf8_strings =
+#ifdef HAVE_W32_SYSTEM
+ 1
+#else
+ 0
+#endif
+ ;
static int maybe_setuid = 1;
static unsigned int opt_set_iobuf_size;
static unsigned int opt_set_iobuf_size_used;
@@ -3406,7 +3412,11 @@ main (int argc, char **argv)
opt.verify_options&=~VERIFY_SHOW_NOTATIONS;
break;
case oUtf8Strings: utf8_strings = 1; break;
- case oNoUtf8Strings: utf8_strings = 0; break;
+ case oNoUtf8Strings:
+#ifdef HAVE_W32_SYSTEM
+ utf8_strings = 0;
+#endif
+ break;
case oDisableCipherAlgo:
{
int algo = string_to_cipher_algo (pargs.r.ret_str);