在mint linux中的“开始”-》“控制面板”-》“系统设置面板”菜单,打开的系统设置界面中,单击“键盘”,打开键盘配置界面,单击“键盘快捷键”标签页,单击“自定义快捷键”打开添加快捷键的对话框,选择带有中文路径的执行文件,如:当前用户目录下的 下载/runwps.sh 在进行选定了后,结果在“指令”栏中显示的为/home/user/%e4%b8%8b%e8%bd%bd/runwps.sh, 其中是由于中文的 下载 二字被 以utf8的编码形式进行了显示,%e4%b8%8b%e8%bd%bd,通过查看此部分的源代码,找到了问题所在,修改如下:
def onfilepicked(self, widget):
//not support chinese in filepath.
#path = self.file_picker.get_uri()[7:]
//support chinese in filepath
path = self.file_picker.get_filename()
self.command_entry.set_text(path)
以上代码中, //not support chinese in filepath. #path = self.file_picker.get_uri()[7:] 是不支持中文的,因为是以uri的形式进行获取的;
此段代码是能够支持中文路径的,至此,问题就解决了; 再次运行就不再有这个问题了;