Patch #1162825: Support non-ASCII characters in IDLE window titles.
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
index 4d67292..ce1fd2a 100644
--- a/Lib/idlelib/IOBinding.py
+++ b/Lib/idlelib/IOBinding.py
@@ -32,6 +32,9 @@
 except (ImportError, locale.Error):
     pass
 
+# Encoding for file names
+filesystemencoding = sys.getfilesystemencoding()
+
 encoding = "ascii"
 if sys.platform == 'win32':
     # On Windows, we could use "mbcs". However, to give the user
@@ -517,7 +520,10 @@
         if not self.opendialog:
             self.opendialog = tkFileDialog.Open(master=self.text,
                                                 filetypes=self.filetypes)
-        return self.opendialog.show(initialdir=dir, initialfile=base)
+        filename = self.opendialog.show(initialdir=dir, initialfile=base)
+        if isinstance(filename, unicode):
+            filename = filename.encode(filesystemencoding)
+        return filename
 
     def defaultfilename(self, mode="open"):
         if self.filename:
@@ -536,7 +542,10 @@
         if not self.savedialog:
             self.savedialog = tkFileDialog.SaveAs(master=self.text,
                                                   filetypes=self.filetypes)
-        return self.savedialog.show(initialdir=dir, initialfile=base)
+        filename = self.savedialog.show(initialdir=dir, initialfile=base)
+        if isinstance(filename, unicode):
+            filename = filename.encode(filesystemencoding)
+        return filename
 
     def updaterecentfileslist(self,filename):
         "Update recent file list on all editor windows"