On Wed, 14 Jul 2021, Sven Schreiber wrote:
Am 13.07.2021 um 23:47 schrieb Allin Cottrell:
> A question for users of gretl on Windows: Do you ever use gretlcli.exe
> in the Windows console (cmd.exe or "PowerShell"), running in a language
> that requires non-ASCII characters to represent gretl's output correctly?
>
> Why I ask: Over the years we've evolved a complex and confusing
> mechanism to try to get this right, by recoding output to the (legacy)
> locale "code page" if necessary. (I'm not sure we always get it right,
> or even that it's possible to get it right in general.)
>
> I'd like to get rid of the complications by, in effect, saying, "gretl
> output will always be encoded in UTF-8, please deal with it." Dealing
> with it, in the Windows console, means setting your "code page" to 65001
> (UTF-8).
>
> So basically I want to know: Would this be OK? Or would it hurt a lot of
> people?
I'm using gretlcli.exe regularly (in German), but only in small batch
mode, where the encoding doesn't really matter. I'm running it simply
within cmd.exe.
I've reminded myself of some details. When gretlcli.exe is run we
check if (a) the console is using a TrueType font and (c) CP 65001
is selectable. In that case we set CP 65001 and arrange for all
gretl output to be in UTF-8, already. No problem.
The nasty complex case arises only gretlcli.exe is being run in a
console window with a bitmap font, or CP 65001 is not available. I'm
not sure if a bitmap font is still the Windows console default, nor
am I sure under what conditions CP 65001 wouldn't be available.
However, if you're just using gretlcli.exe with the -b (batch) flag,
and redirecting output to file, then actually the console character
encoding is in principle irrelevant. So I guess the issue I'm
talking about really only arises in interactive use of gretlcli.exe,
which I suppose would be a rarity.
Allin