[pygtk] Problem in fetching Unicode from URL and displaying it in PyGTK widget
saeed
saeed.gnu at gmail.com
Fri Jul 17 20:23:16 WST 2009
Use function "eval", for example:
data = 'á'
uni = eval("u'\\%s'"%data[2:]) ## u'\xE1' or u'á'
st = uni.encode('utf-8') ## 'á'
Is there another problem?
On 7/17/09, Bertrand Kintanar <b3rxkintanar at gmail.com> wrote:
>
> On 7/17/09 7:53 PM, Chris Camacho wrote:
>> hmmm...
>>
>> being that
>>
>> print '\\'
>>
>> displays
>>
>> '\'
>>
>> isn't that a bug?
>>
>>
> that is one of my question that it been troubling me. why is replace
> have a special treatment in dealing with escape characters while other
> function such as print does the exact thing which escapes the character.
> if i follow it correctly replace should only see one backslash to be
> inserted in the string instead of two.
>
> i have found this post in python mailing list:
>
> http://mail.python.org/pipermail/python-list/2007-May/614590.html.
>
> But I want the exact opposite from that post. from HTML entries to
> Unicode. so there must be some way to reverse that function. correct?
>
> _______________________________________________
> pygtk mailing list pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
More information about the pygtk
mailing list