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

When you edit a UTF-8 file in Visual Studio, it adds the byte order mark (BOM) sequence to the beginning of the file. You can select an encoding manually, 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. You can configure which files to encode based on the file path and the file extension (by default, only .html files are protected from Visual Studio).

You can download the free Fix File Encoding extension for Visual Studio 2010 and Visual Studio 2012 from the Fix File Encoding homepage.

This entry was posted in Vlasov Studio tools and tagged , , . Bookmark the permalink.

5 Responses to Fix File Encoding extension prevents Visual Studio 2012/2010 from adding BOM to UTF-8 files

  1. Hongbo Ni says:

    Visual Studio 2012/2010 can load a source file with UTF8 encoding without BOM(codepage 65001), but it will be saved as codepage 1252 instead of 65001. Can you please fix this using your extension?

    • Hongbo,

      Currently Fix File Encoding doesn’t know “real” encoding of a source file on disk. It can only check the encoding Visual Studio loaded the file with.

      If it is OK for you to save *all* codepage 1252 files as UTF8 encoding without BOM, then I think this functionality can be added relatively easy.

      • Hongbo Ni says:

        Hi Sergey,

        Yes it’s OK to save all RC files with codepage 1252 as UTF8 (codepage 65001). Please make sure that you convert to UTF8 from internal UTF16, not from ascii with codepage 1252.

  2. zack says:

    1)
    This encoding from VS 2013 Update 4 does not work. When I save a file with UTF8 encoding and without BOOM and open it with notepad++
    the encoding says: ANSI.
    2)
    Also when I save a file saved with your enabled extension, I always see in the advanced save option this:”Western europe – codepage 1252″ Is this normal behavior?

    • This extension only changes encoding from UTF-8 to UTF-8 without signature. If your original file is in the “Western europe – codepage 1252” encoding, it won’t be affected.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s