Re: [xml] python, xml, utf8->iso-8859-2 problem

Good shot

thank you, very much

On 18 Feb 2003, Hannu Krosing wrote:

Pavel Stehule kirjutas T, 18.02.2003 kell 10:17:
On Mon, 17 Feb 2003, Daniel Veillard wrote:

On Mon, Feb 17, 2003 at 08:09:09PM +0100, Pavel Stehule wrote:
element.newChild(None,"beta","¾lutý kùò")

element.newChild(None,"beta",u"¾lutý kùò".encode('utf-8'))

so yout automatic conversion from makes the u"xxx" part
convert from iso-8859-2 to pythons internal unicode UCS-2 (or UCS-4) and
the encode('utf-8') part makes libxml2 happy by giving it a
non-python-unicode 8-byte utf-8 string ;)

xml mailing list, project page
xml gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]