Message47962
Logged In: YES
user_id=495142
Thank you for your comment.
First, indeed some titles may fail to be decoded, but it will be sufficient to
use 'ignore' as the error handling scheme. At least it gives more readable
titles than the present "mojibake'd" ones.
Second, the title comes from either sys.argv or tkFileDialog. tkFileDialog
calls tk_getOpenFile and tk_getSaveFile of Tck/Tk. So you are right. It
would be better to use sys.getfilesystemencoding(). Note that the patch
does not affect any unicode titles.
As for OSX, it seems that tk_getOpenFile sometimes returns a broken
string unless you set LANG so as to use UTF-8 (en_US.UTF-8,
ja_JP.UTF-8 etc.). You can see it as follows:
$ LANG=ja_JP.SJIS wish8.4
% tk_getOpenFile
For a folder name of Japanese characters, you will get a broken result; it is
neither UTF-8 nor SJIS. The same problem applies to eucJP. It is a bug
of Tcl/Tk (I found it in Aqua Tcl/Tk 8.4.9) and affects the original IDLE, too.
All in all, it would be the most reasonable to use
sys.getfilesystemencoding() and 'ignore' scheme for now.
|
|
Date |
User |
Action |
Args |
2007-08-23 15:42:11 | admin | link | issue1162825 messages |
2007-08-23 15:42:11 | admin | create | |
|