Change encoding for .js file

OK, I've wasted an hour trying to figure out HOW TO CHANGE ENCODING of .js files...

The file is encoded in Win-1251, but Idea X is brain-dead-stubborn trying to read it as UTF8.

I've changed project-level encoding to Win-1251. I've disabled UTF8 autodetection. I've searched the Knowledgebase and forums. I've prayed to Javanese gods. Nothing helps. :(

All the other files have correct encodings, but those  freaking .js are still UTF8 no matter what, and even refuse to change encoding manually file by file (the option is grayed).... Crap!

So, could anyone please please show me the way cause I've gone crazy and start hating Idea for the rest of my life?

1 comment
Comment actions Permalink

Works for me. But I remember that IDEA honors any existing byte order markers.
Maybe your *.js files have a BOM at the beginning (although that's not recommended for UTF-8 some editors insert a BOM)? See http://en.wikipedia.org/wiki/Byte_order_mark
Have a look with a hex editor and check if the files start with EF BB BF.
In that case: I don't know of any way to have IDEA itself change the encoding, but removing the first 3 bytes with a hex editor should do the job.

On 15.02.2011 11:50, Ar Vicco wrote:

OK, I've wasted an hour trying to figure out HOW TO CHANGE ENCODING of .js files...

>

The file is encoded in Win-1251, but Idea X is brain-dead-stubborn trying to read it as UTF8.

>

I've changed project-level encoding to Win-1251. I've disabled UTF8 autodetection. I've searched the Knowledgebase and forums. I've prayed to Javanese gods. Nothing helps. :(

>

All the other files have correct encodings, but those  freaking .js are still UTF8 no matter what, and even refuse to change encoding manually file by file (the option is grayed).... Crap!

>

So, could anyone please please show me the way cause I've gone crazy and start hating Idea for the rest of my life?

>

---
Original message URL: http://devnet.jetbrains.net/message/5286544#5286544


0

Please sign in to leave a comment.