[Python-Dev] Python's Unicode width default (New Py_UNICODE doc)
Shane Hathaway
shane at hathawaymix.org
Sat May 14 21:05:19 CEST 2005
M.-A. Lemburg wrote:
> It is important to be able to rely on a default that
> is used when no special options are given. The decision
> to use UCS2 or UCS4 is much too important to be
> left to a configure script.
Should the choice be a runtime decision? I think it should be. That
could mean two unicode types, a call similar to
sys.setdefaultencoding(), a new unicode extension module, or something else.
BTW, thanks for discussing these issues. I tried to write a patch to
the unicode API documentation, but it's hard to know just what to write.
I think I can say this: "sometimes your strings are UTF-16, so you're
working with code units that are not necessarily complete code points;
sometimes your strings are UCS4, so you're working with code units that
are also complete code points. The choice between UTF-16 and UCS4 is
made at the time the Python interpreter is compiled and the default
choice varies by operating system and configuration."
Shane
More information about the Python-Dev
mailing list