[Patches] [ python-Patches-435971 ] Adds a UTF-7 codec

noreply@sourceforge.net noreply@sourceforge.net
Mon, 25 Jun 2001 11:10:15 -0700


Patches item #435971, was opened at 2001-06-24 19:57
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=435971&group_id=5470

Category: core (C code)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Brian Quinlan (bquinlan)
Assigned to: M.-A. Lemburg (lemburg)
Summary: Adds a UTF-7 codec

Initial Comment:
This code adds UTF-7 (as described in RFC2152) support 
to Python.

The encoder is hardwired in _codecsmodule.c to not 
encode allowable whitespace and set O characters (see 
RFC2152). If there is a standardized way (keyword 
arguments?) of passing optional arguments to encode 
methods, it would be trivial to make it possible to do 
so. 

Otherwise the patch is pretty straight-forward, I 
think. It touches:

Objects/unicodeobject.c
Modules/_codecsmodule.c
Lib/test/test_unicode.py
Include/unicodeobject.h

and adds a new file:
Lib/encodings/utf_7.py



----------------------------------------------------------------------

>Comment By: Brian Quinlan (bquinlan)
Date: 2001-06-25 11:10

Message:
Logged In: YES 
user_id=108973

OK, I see the utf-16 example. In a few weeks, when I have 
some time again, I might do the necessary changes and 
testing. It might even be nice to be able to specify a list 
of characters to escape, if they are dangerous for your 
application (of maybe it's just morning featuritis :-)).

----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2001-06-25 04:24

Message:
Logged In: YES 
user_id=38388

encode functions can have optionl arguments (see for example
the utf-16 codec or the charmap codec). They don't need to
be keyword arguments although this would make them easier to
handle in case we should ever want to change the API.

I'll look at the patch more closely later this week or
today.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=435971&group_id=5470