[XML-SIG] Strings or Unicode ?
Martin v. Loewis
martin@v.loewis.de
Fri, 9 Nov 2001 21:05:18 +0100
> In a nutshell this means "return unicode unless it's convertible to
> latin-1, then return a latin1-encoded bytestring". I wonder if that is
> exactly what you said above, or only very similar.
No. If it is a Latin-1 string containing accented characters, it
should be converted to Unicode. Otherwise, suppose somebody does
result = u"<"+elem.nodeName
it will give a UnicodeError. OTOH, if you only create byte strings if
the string is ASCII, combining it with either byte strings or Unicode
strings will succeed.
Regards,
Martin