Allows unicode output #64

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants

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 commented on cd79c28 Sep 2, 2011

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'
Owner

coryalder replied Sep 2, 2011

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.

:)

Contributor

esseks commented Sep 7, 2011

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.

Contributor

einars commented May 31, 2012

Is this still open?

Contributor

einars commented Feb 6, 2013

Closing as inactive

einars closed this Feb 6, 2013

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