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



Hello,

I have a problem with building xml document and saving in latin2 encoding. 
I use libxml 2.5.2 compiled with iconv support 

#!/usr/local/bin/python
import libxml2, sys
doc = libxml2.newDoc("1.0")
element = doc.newChild(None,"omega","data")
element.setProp("id","112222")
element.newChild(None,"beta","¾lutý kùò")
print  doc.serialize("iso-8859-2")

make error

output conversion failed due to conv error
Bytes: 0xBE 0x6C 0x75 0x74
xmlOutputBufferFlush: encoder error

with last line doc.serialize("utf-8") works well.

I have question. Do support iconv transformation utf->latin2? How I can 
save xml in latin2 encoding? Have I write own output conversion routine?

Thank you
PS





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