On 10/06/2015 0:23, Allin Cottrell wrote:
Well, there's _one_ more attempt in CVS and
snapshots. Via trial and error I found that using
SetConsoleOutputCP() with an argument of UTF-8 does work (at
least on my Windows 8) if (only if) the console font is TrueType
(as opposed to the default raster font).
If I undestand ok, this is the result, Allin, with Windows 8.1,
Gretl 1.10.90cvs (2015/06/09) in Galician (a language
twinned with Portuguese and Spanish).
I can't find a proper account of how to tell if the active
console font is TrueType but I'm trying a hackish heuristic. I'd
be interested to hear if this works for anyone else.
To set a TrueType font, right-click on the title bar of the
cmd.exe window, choose Properties and then the Font tab. In
Windows 8 there's a choice of Lucida Console or Consolas. I
think that Lucida Console, at least, may be available in earlier
For the record: if my heuristic suggests that a TrueType font is
in use, we ask Windows to switch to "code page 65001" (UTF-8)
and bind gretl's translations to produce UTF-8. In principle
this should also take care of strings passed to "print" and
"printf" provided they are in UTF-8. If the heuristic suggests
that a raster font is in use we detect the active console code
page and bind gretl's translations to emit text in that encoding
-- in which case gretl's print and printf are not handled
Only trying to help (I donīt use gretlcli )...