Change the encoding of a file in Visual Studio Code

Fernando Tholl picture Fernando Tholl · May 6, 2015 · Viewed 186.6k times · Source

Is there any way to change the encoding of a file? For example UTF-8 to ISO 8859-1?

Setting Example Sublime Text:

"default_encoding": "UTF-8"

Answer

DarkNeuron picture DarkNeuron · Nov 1, 2016

So here's how to do that:

In the bottom bar of VSCode, you'll see the label UTF-8. Click it. A popup opens. Click Save with encoding. You can now pick a new encoding for that file.

Alternatively, you can change the setting globally in Workspace/User settings using the setting "files.encoding": "utf8". If using the graphical settings page in VSCode, simply search for encoding. Do note however that this only applies to newly created files.