tkFileDialog.askdirectory()
ディレクトリに非ASCII文字が含まれている場合、Windowsで問題が発生しています。
次に例を示します。
import tkFileDialog
# Open folder C:\notused\weekly\1\Music\岩崎 琢
# (But while the dialog is open, the dialog itself shows the name mangled
# as "C:\notused\weekly\1\Music\?? ?")
o_result = tkFileDialog.askdirectory()
# Return result is unicode, which is correct..
print type(o_result)
# ...but the result string has the non-English characters mangled.
print o_result
# And it's not just the display, they seem to be actually mangled.
print ord(o_result[-1])
# The ordinal value of the final character is the same as the question-mark
print ord('?')
ダイアログ自体に、触れる前に壊れた文字列が表示されていることに気付きました (これは、私の側の処理エラーではないことを示しています) が、askdirectory()
この場合に正しく機能させるために変更する追加のパラメーターや設定が見つかりません。 .
私は何が欠けていますか?