Re: Problem with national characters



"Martin v. Löwis" skrev:

> You need to do locale.setlocale(locale.LC_ALL, "") to get
> locale-specific upper-casing.

That makes a lot of sense. Thank you.

>>> 'før'.upper()
'F\xf8R'
>>> 'FØR'
'F\xd8R'
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
'no_NO'
>>> 'før'.upper()
'F\xd8R'
>>> 'FØR'
'F\xd8R'

I must make a note of the LC_ALL variable in the installation README.
I for one have been running Gentoo Linux for two years without ever
setting the locale, - but now I've finally gotten around to write my
own /etc/env.d/02locale file :-)

> Notice that things are more difficult in the Windows terminal window,
> as this uses an encoding different from the one that the system's
> locale functions expect.

The real input will come from a GUI or a browser interface, so the
Windows terminal problem isn't really an issue.
--
Leif Biberg Kristensen
http://solumslekt.org/
.



Relevant Pages

  • Re: easiest way to change my locale?
    ... A GUI method would be desirable. ... However, once a user has selected a locale, how ... GUI way to let a user choose these kind of options. ... Any plans in Ubuntu ...
    (Ubuntu)
  • Re: characters problem
    ... i'm french and i'm using fedora core 4. ... I only work in console mode ... (GUI is not installed) ... If i run locale on my system: ...
    (Fedora)
  • Re: UTF-8 in some emails?
    ... On Sat, 15 Jul 2006, in the Usenet newsgroup comp.mail.sendmail, in article ... Are the LOCALE the same? ... How - if you are running a GUI login ...
    (comp.mail.sendmail)
  • locale error help
    ... Just installed RHEL4 U2 and when the machine boots and if I launch ... the date gui I see the following errors does anyone know what to try ... Using the fallback 'C' locale. ...
    (RedHat)