This patchset implements Unicode/encoding support for console mode gnuplot. It works very similar to the patches for wgnuplot [#727]:
ConsoleReadCh internally handles Unicode input and translates it to the currently set encoding.ConsolePutS and ConsolePutCh, which handle encodings and use the WCHAR Console API variant. ConsolePutCh shares a large fraction of the code with wgnuplot's equivalent TextPutCh.command.c | 61 -----------
plot.c | 27 -----
readline.c | 10 +
syscfg.h | 2
win/winmain.c | 307 +++++++++++++++++++++++++++++++++++++++++-----------------
win/winmain.h | 1
win/wtext.c | 72 -------------
win/wtext.h | 27 ++---
8 files changed, 251 insertions(+), 256 deletions(-)
Double wide characters (i.e. Japanese) currently do not display at all on my system when using cmd.exe as the shell, allthough the input works just fine. That might have to do with local fonts. Hence, I also cannot test if overwriting / erasing those characters in readline.c would require one or two space/backspace characters. You can switch that behaviour by defining WGP_CONSOLE_DOUBLE_WIDTH during compilation.
Screenshots with mintty/bash/winpty and cmd consoles.
In CVS now. If necessary, handling of double-wide characters can be fixed later. Chances are likely 50:50 that I got it right...
No feedback so far - so I may have gotten it right... Closing.