Edgewall Software

Changes between Version 1 and Version 2 of UnicodeEncodeError


Ignore:
Timestamp:
Mar 2, 2007, 1:57:35 PM (17 years ago)
Author:
Christian Boos
Comment:

make the "python interactive session" blocks narrower

Legend:

Unmodified
Added
Removed
Modified
  • UnicodeEncodeError

    v1 v2  
    33It means that a given `unicode` object (i.e. the Python internal representation for a sequence of internationalized characters conforming to the Unicode standard) failed to be converted to a `str` object (i.e. a sequence of bytes). The failure means that there was a character which couldn't be represented by an appropriate sequence of bytes in the chosen output encoding.
    44
    5 In practice, the default conversion being a "strict" one using the default encoding, which is 'ascii' most of the time, as soon as the `unicode` object contains characters outside of the ASCII range of characters (codepoint 0 to 127), the error will happen.
     5In practice, the default conversion being a "strict" one using the default encoding, which is 'ascii' most of the time, the error will happen as soon as the `unicode` object contains characters outside of the ASCII range of characters (codepoint 0 to 127).
    66
    77This error was frequently seen during the transition to internal use of `unicode` that happened in Trac [milestone:0.10], and can still be seen now and then with Trac plugins that are not using the Trac API the way they should.
     
    1313Traceback (most recent call last):
    1414  File "<stdin>", line 1, in ?
    15 UnicodeEncodeError: 'ascii' codec can't encode character u'\xee' in position 3: ordinal not in range(128)
     15UnicodeEncodeError: 'ascii' codec can't encode character u'\xee'
     16                    in position 3: ordinal not in range(128)
    1617>>>
    1718}}}
     
    2223Traceback (most recent call last):
    2324  File "<stdin>", line 1, in ?
    24 UnicodeEncodeError: 'ascii' codec can't encode character u'\xee' in position 3: ordinal not in range(128)
     25UnicodeEncodeError: 'ascii' codec can't encode character u'\xee'
     26                    in position 3: ordinal not in range(128)
    2527}}}
    2628