This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Console codepage setting via chcp?


On Sep 25 17:41, Andy Koppe wrote:
> 2009/9/25 Corinna Vinschen:
> > However, the
> > longer I think about it, the more I think that using UTF-8 exclusively
> > for system object names is the right thing to do in the long run. ?If
> > there's really a sense in switching the charset for those objects, it
> > shouldn't change within a session. ?At least for 1.7.1! ?We can always
> > macerate this concept later, but right now, it looks like making the
> > changes you're asking for could easily take a couple more months. ?We
> > should not turn the code entirely upside down at this point in time, but
> > get 1.7.1 out first, and I would like to have a concept in 1.7.1 which
> > is at least safe enough to let me sleep at night.
> 
> I understand.
> 
> Right, here's what I gather you've got planned now. Please correct what's wrong:
> 
> - System objects will always be translated using UTF-8. This includes
> file names, user names, and initial environment variables (and
> probably more I'm not aware of).

More than 10 minutes later I'm still thinking that this is the best
solution in the long run.  There will be no situation in which any
process running on the system has a different idea of a system object
than any other process.  That could also help to avoid interoperability
issues in client/server applications.

I'm planning to keep the code in which allows to switch the charset,
I'd just not utilize it.

> - The "C" locale's charset will be UTF-8.

Yes.

> - There'll be language-neutral "C.<charset>" locales.

Yes.

> - The user's ANSI codepage will remain the default charset for
> "language_TERRITORY" locales.

Yes.

> -  The console charset will be set according to LC_ALL/LC_CTYPE/LANG
> when cygwin1.dll is initialised. (Or will 'setcons' be needed for
> that?)

Hmm.  Unsure.  I know that Thomas dislikes the idea and you are not
overly convinced either.  One of Thomas arguments is the non-standard
tool necessary to switch the terminal charset.  I think that's not a
valid argument.  There is no standard how to switch the charset used by
a terminal.  So, utiizing the initial setting of LC_ALL/ff. is as good
as defaulting to UTF-8 and allowing to switch via a setcons tool.  I have
found an easy way to allow a setcons tool which only switches the charset
used by Cygwin.  It doesn't affect the setting in cmd, or made by chcp.

Anyway, I'm still open for discussion.

> - setlocale() will have no effects beyond what's expected in Linux.

Well... probably.  I'm not saying yes without asking a lawyer first.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]