[Twisted-Python] raw xml to element, char encoding/decoding error

Ralph Meijer twisted at ralphm.ik.nu
Wed Feb 18 07:14:20 MST 2009


On 2009-02-18 14:57, Gabriel Rossetti wrote:
> Ralph Meijer wrote:
>> On 2009-02-18 12:14, Gabriel Rossetti wrote:
>> [..]
 >>
>> Parser input is expected to be a string, not unicode. Try this instead:
>>
>>   parser.parse(tmp.toXml().encode('utf-8'))
>>
>> ralphm
>>
> Hello Ralphm,
> 
> yes, I had fixed that in the code attached in my last msg, it only works 
> in Eclipse though.

Ah, but in /that/ code, you typed:

     res = rawXmlToElement("<t>reçu</t>")

While you should have:

     res = rawXmlToElement(u"<t>reçu</t>")

ralphm




More information about the Twisted-Python mailing list