Olivier Mascia wrote:
>> Le 11 f?vr. 2016 ? 23:13, Clemens Ladisch <clemens at ladisch.de> a ?crit :
>> - stdin from the console
>
> Convert from the codepage returned by GetConsoleCP() to UTF8.

>> - stdout to the console
>
> Convert from UTF8 to the codepage returned by GetConsoleOutputCP().

This would corrupt any characters not in that code page.

When we need to handle Windows console I/O specially, we could just as
well use _O_U8TEXT, or ReadConsoleW/WriteConsoleW, without lossy
conversions through a code page.

> [...] unless the display font actually supports unicode and UTF8
> encoding, display issues can appear.

If the font does not have the needed glyphs, the console will display
boxes, but it is still possible to copy the correct character values to
the clipboard.

So it would be a bad idea to change sqlite3's output depending on the
current code page or font.

>> - stdin redirected from a file
>
> Personal opinion: I'd like it to treat input as implicitly in UTF8 as today.

>> - stdout redirected to a file
>
> Personal opinion: I'd like it to output UTF8.

Of course; but we need to detect it.

(And there's the question of "sqlite3 < somefile" vs.
"type somefile | sqlite3", which might also behave differently in
"cmd /a" vs. "cmd /u"; but I do not think this is even detectable
reliably.)


Regards,
Clemens

Reply via email to