在 Visual Studio Code 中更改文件的编码 [英] Change the encoding of a file in Visual Studio Code

查看:57
本文介绍了在 Visual Studio Code 中更改文件的编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法改变文件的编码?例如 UTF-8 到 ISO 8859-1?

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

设置示例 Sublime 文本:

Setting Example Sublime Text:

"default_encoding": "UTF-8"

推荐答案

这里是如何做到这一点:

So here's how to do that:

在 VSCode 的底部栏中,您将看到标签 UTF-8.点击它.一个弹出窗口打开.点击保存编码.您现在可以选择一个新的该文件的编码.

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.

或者,您可以使用设置 "files.encoding": "utf8" 在工作区/用户设置中全局更改设置.如果在 VSCode 中使用图形设置页面,只需搜索 encoding.但请注意,这仅适用于新创建的文件.

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.

这篇关于在 Visual Studio Code 中更改文件的编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆