1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Fix UTF-8 flag checks in the Windows conio system.

Having constructed a conio object with its own 'utf8' flag, we should
be checking that flag at time of use rather than the global
conio_use_utf8 (which was already taken into account at setup time).
Otherwise we miss the whole point, which is that without the override
flag turning off UTF-8, _some_ uses of the system should use the
default code page and not UTF-8.
This commit is contained in:
Simon Tatham 2023-05-28 11:28:18 +01:00
parent 8cf372d4a2
commit d22ccbac6f

View File

@ -143,7 +143,7 @@ static void console_write(BinarySink *bs, const void *data, size_t len)
{
ConsoleIO *conio = BinarySink_DOWNCAST(bs, ConsoleIO);
if (conio_use_utf8) {
if (conio->utf8) {
/*
* Convert the UTF-8 input into a wide string.
*/
@ -220,7 +220,7 @@ static bool console_read_line_to_strbuf(ConsoleIO *conio, bool echo,
goto out;
}
if (conio_use_utf8) {
if (conio->utf8) {
wchar_t wbuf[4096];
size_t wlen;