Is Intellij adding BOM when write UTF-8 source files

Hi, Im using Intellij 7.0.5, I am trying to swap my code from using the Windows-1252  encoding to UTF-8. I changed the Settings/General/Fileencoding to UTF8 and restarted Intellij. It opened a file okay (because it had no chars that would be encoded differently in UTF8, Windows-1252 anyway) and could compile a file okay, but when I modified the file within Intellij it actually wrote a UTF8 BOM mark at the start of the file (which I don't want and is not visible within Jetbrains itself) and then complained it couldn't compile the file with the error

Error:(1,0) illegal character \65279

So it seems to be adding a BOM to the file, this is confusing because all the other posts Ive found about Intellij and UTF8 are the opposite, complaiing that it removes BOM from UTf8 files.

If I look in a hex editor it added the following EF BB BF

Additionally the file can no longer be compiled with Java task within ant either after edited in ant. I dont know if the java compiler is meant to be able to handle UTF with BOM or not, if is then maybe it isnt a BOM that Jetbrains is writing but something else

(<javac destdir="${output.dir}"

Ive been fiddling with this all day without making any sense of it, so any help appreciated

thanks Paul

Please sign in to leave a comment.