Merge pull request #3175 from kived/clipboard-sdl2-utf8

force sdl2 clipboard encoding to utf8
This commit is contained in:
Ryan Pessa 2015-03-21 23:32:49 -05:00
commit c2815a0634
1 changed files with 5 additions and 2 deletions

View File

@ -22,8 +22,11 @@ class ClipboardSDL2(ClipboardBase):
def get(self, mimetype):
return _get_text() if _has_text() else ''
def put(self, data='', mimetype='text/plain'):
data = data.encode('utf-8')
def _ensure_clipboard(self):
super(ClipboardSDL2, self)._ensure_clipboard()
self._encoding = 'utf8'
def put(self, data=b'', mimetype='text/plain'):
_set_text(data)
def get_types(self):