mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Patch #1162825: Support non-ASCII characters in IDLE window titles.
This commit is contained in:
parent
1f663574ee
commit
307021f40b
3 changed files with 36 additions and 6 deletions
|
@ -32,6 +32,9 @@ try:
|
|||
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 @@ class IOBinding:
|
|||
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 @@ class IOBinding:
|
|||
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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue