How to setup Visual Studio Code to detect and set the correct encoding on file open

后端 未结 3 1073
暗喜
暗喜 2021-02-01 12:57

I recently started to use Visual Studio Code on Server Systems where I did not have Studio IDE installed. I like it very much but I\'m running into a problem.

When I open

相关标签:
3条回答
  • 2021-02-01 13:09

    Add guide by image :

    File >> Preferences >> Settings

    Enter autoGuessEncoding and make sure checkbox is checked

    0 讨论(0)
  • 2021-02-01 13:14
    • Go to File-> Preferences -> User Settings
    • Add (or update) the entry "files.encoding": "windows1252" to the right editor window and save

    Now VSCode opens all text files using windows-1252 when there is no proper encoding information set.

    EDIT: In 2017's June release the files.autoGuessEncoding setting was introduced. When enabled it will guess the file's encoding as good as possible. Its default value is false .

    0 讨论(0)
  • 2021-02-01 13:30

    To allow Visual Studio Code to automatically detect the encoding of a file, you can set "files.autoGuessEncoding":true (in the settings.json configuration file).

    https://github.com/Microsoft/vscode/pull/21416

    This obviously requires an updated verison of the application compared to when the question was originally asked.

    0 讨论(0)
提交回复
热议问题