[pygtk] problem pasting clipboard content from arabic website (target text/html)
Giuseppe Penone
giuspen at gmail.com
Wed Jan 12 23:24:53 WST 2011
Yes I also was thinking that, being the first two chars not valid (\0xff and
\0xfe), the problem is that I cannot find a reference to understand what is
the encoding according to those chars.
Looking on the html of the webpage it tells utf-8 but probably then firefox
uses another to fill the clipboard.
Regards,
Giuseppe.
On Wed, Jan 12, 2011 at 5:18 PM, Dieter Verfaillie <
dieterv at optionexplicit.be> wrote:
> On 12/01/2011 16:03, Giuseppe Penone wrote:
> > Yes it's mozilla firefox.
> > I tried with
> >
> > input_string.decode("utf-16", "ignore")
> >
> > but what I get is
> >
> > 猼慰瑳汹㵥昢湯楳敺›㌱┰∻㰾灳湡猠祴敬∽潣潬㩲爠摥∻㰾灳湡猠祴敬∽潣潬㩲戠慬正∻䐾㑅䡇‱❈ㅄ☧‹䥁✠❄⼵ㄧ✠ⱄ䨯
> > 䔪✠䐵ⴧ⠠㘹✠㥄䑄䠠䔪㤠䑅⼼灳湡㰾猯慰㹮⼼灳湡
>
> Never had a need for it myself, but I've stumbled over this a couple
> of times: the tuple returned by clipboard.wait_for_targets() seems to
> contain a hint to the encoding of the data. At least in the case where
> you copied from a mozilla application (firefox/thunderbird/maybe
> others).
>
> hth,
> Dieter
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20110112/7bfaff2a/attachment.html>
More information about the pygtk
mailing list