rondevera / jslintmate

Quick, simple JSLint (or JSHint) in TextMate. Hurt your feelings in style. (See the `development` branch for the latest.)
https://rondevera.github.io/jslintmate/
MIT License
207 stars 23 forks source link

UTF-8 support #2

Open jlecour opened 13 years ago

jlecour commented 13 years ago

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

paulmsmith commented 13 years ago

I think I have this issue too.

rondevera commented 12 years ago

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 commented 12 years ago

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.

noniq commented 12 years ago

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.

rondevera commented 12 years ago

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.

unRob commented 12 years ago

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!

heiniuhaha commented 12 years ago

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

loadedsith commented 10 years ago

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.