Allows unicode output #64

Closed
wants to merge 2 commits into
from

Projects

None yet

3 participants

@coryalder

I adapted this as a text-filter in BBEdit, and one issue I ran into is that BBEdit often supplies files with unicode text in them. The filters work fine on this, but when print is called at the end it chokes on the non-ascii character set. A quick .encode('utf-8') fixes this.

Relevant blog post (re BBEdit text filter): http://objectivesea.tumblr.com/post/9700437213/jsbeautifierforbbedit

@einars

This is not good, as it breaks output under python3:

% echo 'var a = 5, b = 6' | python2 python/jsbeautifier.py -
var a = 5,
    b = 6
% echo 'var a = 5, b = 6' | python3 python/jsbeautifier.py -
b'var a = 5,\n    b = 6'

Ah, of course.
I can't seem to duplicate my unicode issues with anything but BBEdit anyway, so perhaps it's only applicable to that.

Thanks for the quick response. If I figure a way to solve this without breaking python 3 I'll send another pull request.

:)

@esseks

Could you provide a test case or a source file which gets choked? So that we could investigate the issue.
Also note that JSB has undergone so many changes, so checkout the very last git revision and check that it still applies.

@einars

Is this still open?

@einars

Closing as inactive

@einars einars closed this Feb 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment