jslintmate icon indicating copy to clipboard operation
jslintmate copied to clipboard

UTF-8 support

Open jlecour opened this issue 14 years ago • 8 comments

Thee is an issue with UTF-8 support.

I don't know if it's from the bundle or JSLint (and JSHint).

Here is a screenshot

jlecour avatar Apr 23 '11 21:04 jlecour

I think I have this issue too.

paulmsmith avatar Aug 25 '11 09:08 paulmsmith

Hey Jérémy and Paul,

Sorry I haven't commented on this sooner! I've been able to reproduce this locally, and keep circling back to it in hopes of fixing it. (I haven't yet, sadly.)

I believe the issue is with JSC -- when given a JS file with non-ASCII characters, it returns poorly encoded results. This part of the stack is even deeper than JSLint, JSHint, and the bundle itself.

I'll keep digging. Any ideas are appreciated!

Cheers, Ron

rondevera avatar Dec 08 '11 06:12 rondevera

Some research in issue #9 considered using iconv to convert the JS file from UTF-8 to ISO8859-1 (which JSC can supposedly handle), but it didn't fail gracefully enough on some characters.

rondevera avatar Jan 12 '12 07:01 rondevera

node.js handles UTF-8 correctly. I created a very rough proof-of-concept patch that replaces jsc with the node.js runtime: https://github.com/die-antwort/jslintmate/compare/38ec6fd...die-antwort:nodejs-experimental

The patch works for me – unfortunately I don’t have enough time right now to do this in a clean way.

noniq avatar Apr 04 '12 10:04 noniq

Interesting work, @noniq -- thanks for investigating!

One of the project goals is to work out of the box, so node.js won't become a dependency. However, I'd be open to defaulting to node.js by default, and using JSC as a fallback, if we can minimize the code differences across runners.

rondevera avatar Apr 09 '12 04:04 rondevera

Possibly unrelated but, when using utf-8 characters (áíó and so on) in comments, the bundle in TM2 throws an 'Unsafe character' warning. JSLint.com, however, throws no errors. Awesome bundle, nevertheless, thanks!

unRob avatar Apr 30 '12 08:04 unRob

I installed this plugin,and I find it's can't identifying information with encode UTF-8. my chinese code become mojibake.

heiniuhaha avatar Aug 29 '12 03:08 heiniuhaha

I was encountering this issue. I just tried and implemented noniq's changes, solved my issue. Now that node has installers, and is much more likely to be on the user's system, that thing you said about node being the default but having a fallback seems quite desirable to me.

loadedsith avatar May 09 '14 14:05 loadedsith