This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: Console codepage setting via chcp?
- From: Andy Koppe <andy dot koppe at gmail dot com>
- To: cygwin-developers at cygwin dot com
- Date: Wed, 23 Sep 2009 20:17:50 +0100
- Subject: Re: Console codepage setting via chcp?
- References: <20090923164812.GG20981@calimero.vinschen.de>
2009/9/23 Corinna Vinschen:
> Right now, if you switch the charset via the setlocale function, you
> also switch the charset used for console output.
That's quite a unique advantage of the Cygwin console actually,
because it means you always get correct output even if you switch
charset on the fly.
A normal terminal, on the other hand, doesn't actually know what
charset the app running inside it is using. Hence, for correct output,
the user has to make sure the terminal and application charsets match,
or use something like 'luit' to translate between them.
>ÂThis is done on the
> grounds that the console isn't capable to switch the console set by
> itself, as it is for terminal emulators like mintty. The problem with
> this approach is even documented in setup2.sgml, just commented out.
> If you use a tool like ssh to connect to a remote machine, then ssh
> uses potentially another locale and charset than the remote shell.
> ssh is always running in the "C" locale
Are you sure? Shouldn't it be calling 'setlocale(LC_ALL, "")', thereby
configuring the console output according to the locale variables?
Andy