Results 1 to 3 of 3

Thread: Python encoding

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    System.gc()'s Avatar
    Join Date: Apr:2007
    Location: back in time
    Posts: 1,075

    Python encoding

    Python : ,
    root folder .

    python-2.7.1-x64 ( Python 2.x) , ,
    ( å, á, ü - ISO-8859 ).
    , python
    (os.path.isfile(x) - False, os.path.isdir(x) - False; os.walk(x) , os.listdir(), ).

    python-3.1.3-x64, Unicode out of the box.
    , , . Locale- OS- , python-3.1.3
    ${python}/Lib/encodings/cp1251.py,
    . :

    Code:
    UnicodeEncodeError: 'charmap' codec can't encode character '\xe5' in position 60: character maps to <undefined>
    , ?

    P.S. - 32bit python-3.1.3 .
    Java , -
    UD3R|Q9550+1283|4x2 G.Skill@1066|MX500+1002FAEX+640AAKS+ST31 60|RX580-8GB|1841BLT|SS-760XP|Define7|z24i|Edifier S350DB
    geniusloci: ) ; ) ; ) ? nope|r.i.p.

  2. #2
    Registered User JACK's Avatar
    Join Date: Mar:2004
    Location:
    Posts: 651
    Jython || IronPython

  3. #3
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    Quote Originally Posted by System.gc() View Post
    python-3.1.3-x64, Unicode out of the box.
    . Python 2.x Unicode out of the box. str , , unicode. , . , . unicode str encode() decode(), unicode() str(). :

    u''.encode('utf8')
    '\xd0\x90\xd0\xbb\xd0\xb0\xd0\xb1\xd0\xb 0\xd0\xbb\xd0\xb0'.decode('utf8')

    Quote Originally Posted by System.gc() View Post
    :

    Code:
    UnicodeEncodeError: 'charmap' codec can't encode character '\xe5'  in position 60: character maps to <undefined>
    , ?

    P.S. - 32bit python-3.1.3 .
    Java , -
    - , -.
    , !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |