-
Use Notepad++ – it is free and much better than Notepad. It will help to save text without a BOM using Encoding → Encode in UTF-8 without BOM:
Notepad++ v6 and olders:
-
When I encountered this problem in Java, I didn’t find any library to parse these first three bytes (BOM). So my advice:
- Use
PushbackInputStream(in, 3)
. - Read the first three bytes
- If it’s not BOM (EF BB BF), push them back
- Process the stream as UTF-8
- Use