如何设置Visual Studio Code在打开文件时检测并设置正确的编码 [英] How to setup Visual Studio Code detect and set correct encoding on file open
问题描述
我最近开始在未安装Studio IDE的服务器系统上使用Visual Studio Code。我非常喜欢,但是遇到了问题。
当我打开文件(之前使用Notepad ++)时,编辑器会检测编码并为我设置。 Windows服务器上仍有许多文件,其中 windows-1252
仍然可用,但 vscode
只需使用 UTF-8
默认情况。
我知道我可以用Western编码重新打开(Windows 1252)
但是我经常忘记它,有时会破坏一些内容来保存它。
所以我还没有找到任何参数,有没有办法使 vscode
是否检测编码并在我打开文件时自动设置它?
允许Visual Studio代码要自动检测文件的编码,可以设置 files.autoGuessEncoding:true
(在 settings.json
配置文件)。
https:/ /github.com/Microsoft/vscode/pull/21416
与最初提出问题的时间相比,这显然需要更新应用程序的版本。 / p>
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 run into a problem.
When I open a file (used Notepad++ before) the editor detect encoding and set it for me. Have many files on windows servers with windows-1252
still but vscode
just use UTF-8
by default.
I know I can reopen with encoding Western (Windows 1252)
but I forgot it often and I sometimes destroyed some content saving it.
So I did not find any parameter yet, is there a way to make vscode
detect encoding and set it automatically when I open a file?
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.
这篇关于如何设置Visual Studio Code在打开文件时检测并设置正确的编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!