Change the encoding of a file in Visual Studio Code

后端 未结 3 978
北海茫月
北海茫月 2020-11-27 14:13

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

Setting Example Sublime Text:



        
3条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 14:48

    Apart from the settings explained in the answer by @DarkNeuron:

    "files.encoding": "any encoding"
    

    you can also specify settings for a specific language like so:

    "[language id]": {
      "files.encoding": "any encoding"
    }
    

    For example, I use this when I need to edit PowerShell files previously created with ISE (which are created in ANSI format):

    "[powershell]": {
        "files.encoding": "windows1252"
    }
    

    You can get a list of identifiers of well-known languages here.

提交回复
热议问题