[Soap-Python] rpclib and unicode strings

azurIt azurit at pobox.sk
Sun Feb 19 19:58:06 CET 2012


Will you fix it in rpclib or should i do it somewhere in my app? tnx

azur



______________________________________________________________
> Od: "Burak Arslan" <burak.arslan at arskom.com.tr>
> Komu: azurIt <azurit at pobox.sk>
> Dátum: 19.02.2012 15:57
> Predmet: Re: [Soap-Python] rpclib and unicode strings
>
> CC: soap at python.org
>On 02/19/12 16:54, azurIt wrote:
>> Little more info:
>> When i send ASCII chars, i got 'str' type but when i send unicode chars, i got 'unicode' type. What should i do to always get unicode?
>>
>
>hi,
>
>you need to provide me with a test case to have something to discuss on.
>
>rpclib relies on lxml for unicode conversion when dealing with xml data. 
>turns out it's a little quirky:
>
>In [4]: a=etree.fromstring('<?xml version="1.0" 
>encoding="UTF-8"?><root><child>data</child></root>')
>
>In [5]: a[0].text
>Out[5]: 'data'
>
>In [6]: a=etree.fromstring('<?xml version="1.0" 
>encoding="UTF-8"?><root><child>dataç</child></root>')
>
>In [7]: a[0].text
>Out[7]: u'data\xe7'
>
>so, doing unicode(str) in 
>https://github.com/arskom/rpclib/blob/master/src/rpclib/model/primitive.py#L142 
>could safely fix your problem. is this ok with you?
>
>best,
>burak
>


More information about the Soap mailing list