Sublime Forum

[bug] Build scripts don't work with unicode paths

#1

Hello.
I have already mentioned this here -> https://forum.sublimetext.com/t/strange-build-script-issue-witch-latex/5720/1 but as I’m sure now that this is a bug I thought I’d file a bug report.

Issue: Build scripts don’t work on files which contain non-ascii characters.

Reproduce: create a file test.py. Past this code into it:

print 'hello world!'

Press f7 and it’ll print “hello world!” to the console.
Now, rename it to “tést.py”, “täst.py” or anything else containing “strange” chars. When trying to build now, an error will show i the sublime console now:

Traceback (most recent call last): File "./sublime_plugin.py", line 325, in run_ File "./exec.py", line 124, in run UnicodeEncodeError: **'ascii' codec can't encode character** u'\xe9' in position 53: ordinal not in range(128)

This is quite annoying to me as german speaker as I often have umlauts in path names. It’d not be that much to fix it I guess just add some "u"s somewhere in the right place :stuck_out_tongue:

Thanks

0 Likes

Bug report: can't build with non-ASCII characters in $file
Strange build script issue witch latex
#2

I suppose that the exec command must be modified with something like:

class ExecCommand(sublime_plugin.WindowCommand, ProcessListener): def run(self, cmd = ], file_regex = "", line_regex = "", working_dir = "", encoding = "utf-8", env = {}, quiet = False, kill = False, # Catches "path" and "shell" **kwargs): cmd = [c.encode(sys.getfilesystemencoding()) for c in cmd] ...
At least it works that way on Windows 7, not sure for other OS.

0 Likes

#3

Thanks very much. Works now under Linux, too. OSX should work then too, I guess.

0 Likes