How to remove BOM in Intellij Idea
There is no such action to remove BOM from UTF-8 files in IntelliJ IDEA. There was a bug that BOM is removed, but it was fixed a long time ago.
When you remove BOM externally, make sure the file is synchronized with editor, try
If IntelliJ IDEA still thinks that this file has BOM, please file an issue with the steps to reproduce.
Tested on PHPStorm 8:
Right click on a file in the project tree, click on "Remove BOM"
(Not sure if it exists on the base platform, comments will be helpful)
Intellij Idea has an option, File->Remove Bom, but it looks doesn't work very well, I got "This file has mandatory Bom" error
The following tips work for me
1) create new empty file (for example: temp123.java)
2) make sure that code-page/encoding for that file is UTF-8
3) copy whole content from original to newly created file (select all, copy, go > to another tab, paste) and save
I referenced link below, can be combined with Intellij Idea File->File Encoding-> Reload/Convert to UTF-8
tsds 12 months
I'd like to remove Bite Order Masks from my
UTF-8 files in Intellij IDEA, how can I do this?
The problem is that if I'm trying to do it via other editors (e.g. Akelpad),
when I modify the file later in IDEA it somehow remembers that BOM
was present and adds it to my file again (((
rsenna almost 10 years+1 for the
File | Synchronizehint. IntelliJ is not able to aptly recognize external BOM changes, but this helps. Still, any further change to the same file, inside IntelliJ, will bring the BOM back... :-/ (IntelliJ CE 12). AFAIK the only way of making this REALLY annoying behavior go away is 1) closing IntelliJ, 2) remove the *&¨*&#ing BOM and 3) reopening it.