New submission from Nick Barnes <[EMAIL PROTECTED]>:

UTF-7 decoding raises an exception for any character not in the RFC2152
"Set D" (directly encoded characters).  In particular, it raises an
exception for characters in "Set O" (optional direct characters), such
as < = > [ ] @ etc.  These characters can legitimately appear in
UTF-7-encoded text, and should be decoded (as themselves).  As it is,
the UTF-7 decoder can't reliably be used to decode any UTF-7 text other
than that encoded by Python's own UTF-7 encoder.

Looking at the source of unicodeobject.c, the call to the SPECIAL macro
on line 1009 has hardcoded second and third arguments of zero.  Maybe
changing the second argument to 1 would fix this.  Maybe.

----------
components: Unicode
messages: 76405
nosy: Nick Barnes
severity: normal
status: open
title: UTF7 decoding is far too strict
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4426>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to