Vscode: Allow to save with UTF-8 + BOM encoding

Created on 27 Nov 2015  路  13Comments  路  Source: microsoft/vscode

In version 0.10.2 I am having issues with making sure a file is saved with UTF-8 and BOM character encoding.

Please add such an option.

feature-request file-explorer verified

Most helpful comment

I mean :+1: for having such an option, but :-1: for any tool that needs BOMs :)

All 13 comments

:+1:

I mean :+1: for having such an option, but :-1: for any tool that needs BOMs :)

@bpasero LOL, like powershell.

My strong position against BOMs is company agnostic ;)

.

I want to this feature too
:+1:

I really need this encoding type too. Is it planned in a future release?

need too :[

Having this capability would unblock PowerShell Script Analyzer identifying a Warning for new scripts authored using VSCode.

Use BOM For Unicode Encoded File

Pushed a change that allows to set a new setting files.bom to one of:

  • preserve (default): keep any existing UTF-8 BOM, but not add it
  • insert: always add a UTF-8 BOM
  • remove: always remove any found UTF-8 BOM

:+1:

Discussed with the team and we favor a different approach that does not include a new setting, instead we piggy back on the existing encoding option and add a new option UTF8 with BOM. This has several advantages:

  • you can easily see if a file has a UTF 8 with BOM or not by looking at the status bar encoding info
  • you can actually convert a file between UTF 8 and UTF 8 with BOM by using the Save with Encoding action from the status bar picker and by picking UTF 8 to remove the BOM and the other to add it

Now is better! you have to be able to save with BOM and save with BOM if the file already has it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omidgolparvar picture omidgolparvar  路  3Comments

borekb picture borekb  路  3Comments

sijad picture sijad  路  3Comments

curtw picture curtw  路  3Comments

philipgiuliani picture philipgiuliani  路  3Comments