Re: problem with unicode

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt Nordhoff

    Re: problem with unicode

    andreas.profous @googlemail.com wrote:
    Hi everybody,
    >
    I'm using the win32 console and have the following short program
    excerpt
    >
    # media is a binary string (mysql escaped zipped file)
    >
    >>print media
    xワユロ[ヨ...
    (works)
    >
    >>print unicode(media)
    UnicodeDecodeEr ror: 'ascii' codec can't decode byte 0x9c in position
    1: ordinal not in range(128)
    (ok i guess print assumes you want to print to ascii)
    <snip more code snippets>
    I don't know what to do. I just want to concatenate two string where
    apparently one is a binary string, the other one is a unicode string
    and I always seem to get this error.
    >
    Any help is appreciated :)
    You should read the Python Unicode documentation, such as:

    <http://boodebr.org/main/python/all-about-python-and-unicode>

    <http://docs.python.org/dev/howto/unicode.html>

    and maybe a non-Python-specific article:

    <http://www.joelonsoftw are.com/articles/Unicode.html>
    --
Working...