diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2018-09-01 21:34:34 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2018-09-01 21:34:37 +0200 |
commit | d1454de7b03c93556c33c33c5fd8db288ab4feac (patch) | |
tree | 0a4af2227d185e96d0684b5b928a96fbf31d7da5 | |
parent | 3a880bf5e0e4a11719c4ca1e42bd718e712fb0d2 (diff) | |
download | cygnal-d1454de7b03c93556c33c33c5fd8db288ab4feac.tar.gz cygnal-d1454de7b03c93556c33c33c5fd8db288ab4feac.tar.bz2 cygnal-d1454de7b03c93556c33c33c5fd8db288ab4feac.zip |
Cygwin: console: Print Unicode REPLACEMENT CHARACTER for invalid input chars
So far we printed a half filled square (0x2592) if the input char is
invalid, but using REPLACEMENT CHARACTER (0xfffd) is apparently the way
to go.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 2a978e746..9a6c9b15e 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -1971,13 +1971,12 @@ bad_escape: } } -/* This gets called when we found an invalid input character. We just - print a half filled square (UTF 0x2592). We have no chance to figure - out the "meaning" of the input char anyway. */ +/* This gets called when we found an invalid input character. + Print Unicode REPLACEMENT CHARACTER (UTF 0xfffd). */ inline void fhandler_console::write_replacement_char () { - static const wchar_t replacement_char = 0x2592; /* Half filled square */ + static const wchar_t replacement_char = 0xfffd; /* REPLACEMENT CHARACTER */ DWORD done; WriteConsoleW (get_output_handle (), &replacement_char, 1, &done, 0); } |