Em 8 de junho de 2015, Allin Cottrell escreveu:
On Mon, 8 Jun 2015, Henrique Andrade wrote:

Dear Allin,

The problem remains :-( Please find attached the scripts I using to test
this. The command I executing in the Windows console is:

"c:\Program Files\gretl\gretlcli.exe" -b "C:\teste\sem_acento.inp" # It
works :-)
"c:\Program Files\gretl\gretlcli.exe" -b "C:\teste\com_acentuação.inp" # I
doesn't work :-(

Can you tell me what gretlcli says on start-up? With the current Windows snapshot you should see something like:

cli_set_win32_charset: charset='CP850'

However, the codepage may or may not be 850. The value shown is the result from a call to the Windows function GetConsoleOutputCP().

The message "cli_set_win32_charset: charset='CP850'" appears, but the problem is still here :-(

Em 9 de junho de 2015, Allin Cottrell escreveu:

Strings produced by the "print" command don't go through the gettext translation mechanism and so are not recoded automatically; in the Windows console they will come out in whatever encoding was used on input.

I thought that perhaps the Windows function SetConsoleOutputCP() might help, but I've now tested on Windows 8 and it doesn't. So at this point you're on your own as regards non-ASCII characters in gretl's print and printf. Doing "chcp 65001" in the Windows console might or might not help.

If you google the issue of character encoding in the Windows console, you'll see it's a total horror show. (Everyone but Microsoft has settled on UTF-8 as the most efficient representation of the world's languages. Windows can be induced to use UTF-8 if the wind is blowing in the right direction and you hold your mouth right, but natively it uses a mash-up of legacy 8-bit "code pages" along with the more bloated representations of unicode.)

Dear Allin, I think your answer is clear enough and it convinces me that we can't "fight" against Windows all the time :-(. Clearly this is not a Gretl's problem and I think all we can do is to mention this Windows limiting feature when users decide to use Gretl CLI.

Thanks a lot for your efforts in Gretl's internationalization and localization!

Henrique Andrade