Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Display JavaScript' command doesn't work with non-ASCII characters #21

Open
masonmark opened this issue Nov 27, 2012 · 2 comments
Open

Comments

@masonmark
Copy link

Valid CoffeeScript won't compile using the 'Display JavaScript' command if there are Japanese or other non-ASCII characters in the file. Instead an error is logged and blank window appears.

This code compiles and displays fine:

foo = "It works with ASCII text."

But, if you add some non-ASCII to the mix, like this, it doesn't work anymore:

foo = "It works with ASCII text."
bar = "日本語だったらダメだ。"

The error printed to console is:

Traceback (most recent call last):
  File "./sublime_plugin.py", line 356, in run_
  File "./CoffeeScript.py", line 88, in run
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 58: ordinal not in range(128)

The version I am using is the current one from Package Control: v2012.07.19.12.47.26; xavura.github.com/CofffeeScript-Sublime-Plugin

@lavrton
Copy link

lavrton commented Nov 29, 2012

I had this problem too. I was adding this:

res['out'] = res['out'].decode('utf8')

to CoffeeScript.py line 83. profit

@Xavura
Copy link
Collaborator

Xavura commented Nov 29, 2012

I'll incorporate the above change soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants