diff -r 9d9495fabeb9 Lib/tkinter/__init__.py --- a/Lib/tkinter/__init__.py Sat May 12 15:51:51 2012 +0200 +++ b/Lib/tkinter/__init__.py Sat May 12 18:17:12 2012 +0100 @@ -540,12 +540,16 @@ The type keyword specifies the form in which the data is to be returned and should be an atom name such as STRING - or FILE_NAME. Type defaults to STRING. + or FILE_NAME. Type defaults to STRING, except on X11, where the default + is UTF8_STRING. This command is equivalent to: selection_get(CLIPBOARD) """ + if 'type' not in kw \ + and self.tk.call(('tk', 'windowingsystem')) == 'x11': + kw['type'] = 'UTF8_STRING' return self.tk.call(('clipboard', 'get') + self._options(kw)) def clipboard_clear(self, **kw): @@ -627,8 +631,12 @@ A keyword parameter selection specifies the name of the selection and defaults to PRIMARY. A keyword parameter displayof specifies a widget on the display - to use.""" + to use. A keyword parameter type specifies the form of data to be + fetched, defaulting to UTF8_STRING on X11 and STRING elsewhere.""" if 'displayof' not in kw: kw['displayof'] = self._w + if 'type' not in kw \ + and self.tk.call(('tk', 'windowingsystem')) == 'x11': + kw['type'] = 'UTF8_STRING' return self.tk.call(('selection', 'get') + self._options(kw)) def selection_handle(self, command, **kw): """Specify a function COMMAND to call if the X