UTF Questions

"Martin v. Löwis" martin at v.loewis.de
Sun Mar 27 12:14:45 CEST 2005


Fuzzyman wrote:
> The codecs module has constants definded for the UTF32 encoding, yet
> this encoding isn't supported as a standard encoding. Why isn't it
> supported ?

Because nobody has contributed such an implementation.

Notice that this is really trivial to implement, with very few lines
of pure Python code. In fact, given a Unicode string s, the line

codecs.BOM_UTF32+array.array("i",map(ord,s)).tostring()

generates UTF-32 for the string s. Creating a codec on top of this
approach is left as an exercise for the reader.

Regards,
Martin



More information about the Python-list mailing list