minidom.parseString and åäö

Martin v. Loewis martin at v.loewis.de
Thu Apr 4 14:48:51 EST 2002


Magnus Heino <magnus.heino at sigma.pleon.se> writes:

> What is the best way to solve this?
> 
> [magnus at daysleeper magnus]$ python2.2
> Python 2.2 (#1, Mar  1 2002, 14:43:56)
> [GCC 2.96 20000731 (Red Hat Linux 7.2 2.96-104)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> mystring='<foo>åäö</foo>'

The best solution is to use well-formed xml, i.e. add a 

<?xml version="1.0" encoding="iso-8859-1"?>

header. Alternatively, encode your document in the XML default
encoding, i.e. UTF-8.

Regards,
Martin




More information about the Python-list mailing list