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 <
diet...@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
>
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to