With Python 3.4 on Windows 7, I use the following code to get text from the clipboard:
import tkinter
r = tkinter.Tk()
text = r.clipboard_get()
r.withdraw()
r.update()
r.destroy()
(This by the way reads the clipboard without showing any window).
The problem is, that this will sometimes produce "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 0: invalid continuation byte".
For example when having this sign in the clipboard:
Is there a way to make tkinter ignore/replace those signs? I do not need them anyway, but other parts of the copied text.