Salve o UTF-8 sem o BOM Visual Studio 2012

9

Parece que o Visual Studio 2012 odeia o UTF-8 sem o BOM e sempre o adiciona, resultando em uma linha vazia nas páginas do PHP.

Como posso alterar a codificação para UTF-8 sem BOM (ou pelo menos para Unicode ...)

    
por Cristy 16.01.2013 / 21:36

1 resposta

9

Veja a extensão Corrigir codificação de arquivo :

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.

Eu não tenho experiência com essa extensão, mas parece que ela atende às suas necessidades.

    
por 05.02.2013 / 19:40