Message19177
The following snippet:
>>> u'@test-\u5171'.encode("mbcs", "strict")
'@test-?'
Should raise a UnicodeError. The errors param is
completely ignored, and the function always works as
though errors='replace'.
Attaching a test case, and the start of a patch. The
patch has a number of issues:
* I'm not sure what errors are considered 'mandatory'.
I have handled 'strict', 'ignore' and 'replace' -
however, 'ignore' and 'replace' currently are exactly
the same (ie, replace)
* The Windows functions don't tell us exactly what
character failed in the conversion. Thus, the
exception I raise implies the first character is the
one that failed. For the same reason, I have made no
attempt to support error callbacks.
Comments/guidance appreciated. |
|
Date |
User |
Action |
Args |
2007-08-23 14:18:31 | admin | link | issue850997 messages |
2007-08-23 14:18:31 | admin | create | |
|