What encoding does u'...' syntax use?

Aahz aahz at pythoncraft.com
Sat Feb 21 18:48:21 CET 2009

In article <499F397C.7030404 at v.loewis.de>,
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?=  <martin at v.loewis.de> wrote:
>> Yes, I know that.  But every concrete representation of a unicode string 
>> has to have an encoding associated with it, including unicode strings 
>> produced by the Python parser when it parses the ascii string "u'\xb5'"
>> My question is: what is that encoding?
>The internal representation is either UTF-16, or UTF-32; which one is
>a compile-time choice (i.e. when the Python interpreter is built).

Wait, I thought it was UCS-2 or UCS-4?  Or am I misremembering the
countless threads about the distinction between UTF and UCS?
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Weinberg's Second Law: If builders built buildings the way programmers wrote 
programs, then the first woodpecker that came along would destroy civilization.

More information about the Python-list mailing list