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 takluyver
Date 2012-05-10.22:47:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1336690077.5.0.0628232128549.issue14777@psf.upfronthosting.co.za>
In-reply-to
Content
With the text 'abc€' copied to the clipboard, on Linux, where UTF-8 is the default encoding:

Python 3.2.3 (default, Apr 12 2012, 21:55:50) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> root = tkinter.Tk()
>>> root.clipboard_get()
'abcâ\x82¬'
>>> 'abc€'.encode('utf-8').decode('latin-1')
'abcâ\x82¬'

I see the same behaviour in 2.7.3 as well (it returns a unicode string u'abc\xe2\x82\xac').

If the clipboard is only accessible at a bytes level, I think clipboard_get should return a bytes object. But I can reliably copy and paste non-ascii characters between programs, so it looks like it's possible to return unicode.
History
Date User Action Args
2012-05-10 22:47:57takluyversetrecipients: + takluyver
2012-05-10 22:47:57takluyversetmessageid: <1336690077.5.0.0628232128549.issue14777@psf.upfronthosting.co.za>
2012-05-10 22:47:56takluyverlinkissue14777 messages
2012-05-10 22:47:56takluyvercreate