Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It seems that Visual Studio 2012 hates UTF-8 without BOM and always adds it, resulting in an empty line in PHP pages.

How can I change the encoding to UTF-8 without BOM (or at least to Unicode...)

share|improve this question
Please add some more info about what you are doing. – harrymc Feb 5 '13 at 16:23
I can not save documents with UTF-8 without BOM encoding using Visual Studio 2012. I have to edit the file in Notepad++ every time to change to that encoding. – Cristy Feb 5 '13 at 18:20
up vote 8 down vote accepted

See the free Fix File Encoding extension :

The free Fix File Encoding extension prevents Visual Studio 2012/2010 from adding BOM to UTF-8 files.

Normally, when you edit a UTF-8 file in Visual Studio, it adds the byte order mark (BOM) sequence 0xEF, 0xBB, 0xBF to the beginning of the file. Sometimes it confuses other applications further processing the file. You can select an encoding manually (File - Advanced Save Options... or File - Save As... - Save with Encoding...), but you need to do it each time you reopen the file:

Fix File Encoding automatically detects when a UTF-8 file is opened in Visual Studio and sets its encoding to UTF-8 without signature. If you don't edit the file, it remains unmodified. If you edit the file, it will be saved without the BOM.

Fix File Encoding lets you configure which files to encode based on the file path and the file extension. By default, only .html files are protected from Visual Studio.

I have no experience with this extension, but it sounds like it answers your needs.

share|improve this answer
Nice one! Thanks. – L-Four Nov 21 '14 at 11:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.