This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author takluyver
Recipients ned.deily, serhiy.storchaka, takluyver, terry.reedy
Date 2012-05-11.19:31:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1336764693.43.0.999857931154.issue14777@psf.upfronthosting.co.za>
In-reply-to
Content
OK, after a quick bit of reading, I see why I'm confused: the clipboard actually works by requesting the text from the source program, so where you copy it from makes a difference. In my case, copying from firefox gives 'abc\\u20ac', and copying from Geany gives u'abc\xe2\x82\xac'.

However, I still think there's something that can be improved in Python. As Serhiy points out, specifying type='UTF8_STRING' makes it work properly from both programs. The Tcl documentation recommends this as the best option for "modern X11 systems"[1].

From what Ned says, we can't make UTF8_STRING the default everywhere, but is there a way to detect if we're inside X11, and use UTF8_STRING by default there?

[1] http://www.tcl.tk/man/tcl/TkCmd/clipboard.htm
History
Date User Action Args
2012-05-11 19:31:33takluyversetrecipients: + takluyver, terry.reedy, ned.deily, serhiy.storchaka
2012-05-11 19:31:33takluyversetmessageid: <1336764693.43.0.999857931154.issue14777@psf.upfronthosting.co.za>
2012-05-11 19:31:32takluyverlinkissue14777 messages
2012-05-11 19:31:32takluyvercreate