[EMAIL PROTECTED] wrote:

> I wanted to see what would happen if one used the results of a tostring
> method as input into the XML method.  What I observed is this:
> a) beforeCtag.text is of type <type 'str'>
> b) beforeCtag.text when printed displays: I'm confused
> c) afterCtag.text is of type <type 'unicode'>
> d) afterCtag.text when printed displays: I?m confused

the XML file format isn't a Python string serialization format, it's an XML 
infoset
serialization format.

as stated in the documentation, ET always uses Unicode strings for text that
contain non-ASCII characters.  for text that *only* contains ASCII, it may use
either Unicode strings or 8-bit strings, depending on the implementation.

the behaviour if you're passing in non-ASCII text as 8-bit strings is undefined
(which means that you shouldn't do that; it's not portable).

to learn more about Unicode in Python, google for "python unicode".

</F>



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to