<type 'unicode'>

Peter Hansen peter at engcorp.com
Mon May 6 20:00:17 EDT 2002


Billy Ng wrote:
> 
> Thanks guys!  I have one more question.  In the xml doc, I have already
> defined
> 
> <?xml version='1.0' encoding="UTF-8"?>
> 
> How come it still returns me unicode?

The raw XML data is not in Unicode, it is "encoded" in UTF-8, which
is a special way of representing information that ends up in memory
as Unicode characters.  (Actually, it might stay as UTF-8 or even
become some other encoding, but that's beside the point.)

If the XML file really contained Unicode, you wouldn't have to
specifying an encoding at all...  (i.e. UTF-8 is not Unicode.)

-Peter



More information about the Python-list mailing list