Re: Python 2.5.2 on Ubuntu Hardy Utf-8-Euro error



The function first normalizes the "@" away and then looks for it. Is that
the expected behaviour?

I believe this functionality is broken by design. Python can't possibly
know correctly what each locale name on each system means, and what
encoding is used in the locale.

Instead, the system's API to find out the encoding should be used,
as exposed in locale.getpreferredencoding().

Regards,
Martin
.



Relevant Pages

  • Re: python3 - the hardest hello world ever ?
    ... outputting the internal unicode string to a file. ... the _encoding property. ... I wished I could override the locale settings within a Python script. ...
    (comp.lang.python)
  • preferred way to set encoding for print
    ... i am doing my first steps in the wonderful world of python 3. ... to use any encoding in the world, but wouldn't it have been less of a ... sitecustomize.py, or similar, to use utf-8 as a default encoding? ... that locale beast with anything but the empty string or 'C' were all ...
    (comp.lang.python)
  • Re: preferred way to set encoding for print
    ... i am doing my first steps in the wonderful world of python 3. ... to use any encoding in the world, but wouldn't it have been less of a ... that locale beast with anything but the empty string or 'C' were all ... I work with Chinese all the time on a U.S. Windows system. ...
    (comp.lang.python)
  • Re: How to print a unicode string?
    ... to set the encoding to be used for the output ... Because the Python 'locale' module is all about using the OS's ... locale support. ...
    (comp.lang.python)
  • Re: How to model Enumerations in a Table
    ... I have an awful feeling that you may have some serious design problems, ... Also enumeration codes are the weakest of all encoding designs. ... Let me give ONE of about two dozen problems with an OTLT. ... A table is a set; a set is made up of things of the same kind; SQL ...
    (microsoft.public.sqlserver.programming)