Unicode issue on Windows cmd line

jeffg jeffgemail at gmail.com
Wed Feb 11 14:50:32 EST 2009


On Feb 11, 2:35 pm, Albert Hopkins <mar... at letterboxes.org> wrote:
> On Wed, 2009-02-11 at 10:35 -0800, jeffg wrote:
> > Having issue on Windows cmd.
> > > Python.exe
> > >>>a = u'\xf0'
> > >>>print a
>
> > This gives a unicode error.
>
> > Works fine in IDLE, PythonWin, and my Macbook but I need to run this
> > from a windows batch.
>
> > Character should look like this "ð".
>
> > Please help!
>
> You forgot to paste the error.

The error looks like this:
    File "<stdin", line 1, in <module>
    File "C:\python25\lib\encodings\cp437.py", line 12, in encode
      return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\xf0' in
position 0
: character maps to <undefined>


Running Python 2.5.4 on Windows XP



More information about the Python-list mailing list