• <legend id='Yjhal'><style id='Yjhal'><dir id='Yjhal'><q id='Yjhal'></q></dir></style></legend>
      <tfoot id='Yjhal'></tfoot>
      • <bdo id='Yjhal'></bdo><ul id='Yjhal'></ul>
    1. <i id='Yjhal'><tr id='Yjhal'><dt id='Yjhal'><q id='Yjhal'><span id='Yjhal'><b id='Yjhal'><form id='Yjhal'><ins id='Yjhal'></ins><ul id='Yjhal'></ul><sub id='Yjhal'></sub></form><legend id='Yjhal'></legend><bdo id='Yjhal'><pre id='Yjhal'><center id='Yjhal'></center></pre></bdo></b><th id='Yjhal'></th></span></q></dt></tr></i><div id='Yjhal'><tfoot id='Yjhal'></tfoot><dl id='Yjhal'><fieldset id='Yjhal'></fieldset></dl></div>

        <small id='Yjhal'></small><noframes id='Yjhal'>

        Visual Studio 2017 中源文件的默认编码是什么?

        时间:2023-05-21

            <tfoot id='M0OaE'></tfoot>

              <bdo id='M0OaE'></bdo><ul id='M0OaE'></ul>
                <tbody id='M0OaE'></tbody>
              <i id='M0OaE'><tr id='M0OaE'><dt id='M0OaE'><q id='M0OaE'><span id='M0OaE'><b id='M0OaE'><form id='M0OaE'><ins id='M0OaE'></ins><ul id='M0OaE'></ul><sub id='M0OaE'></sub></form><legend id='M0OaE'></legend><bdo id='M0OaE'><pre id='M0OaE'><center id='M0OaE'></center></pre></bdo></b><th id='M0OaE'></th></span></q></dt></tr></i><div id='M0OaE'><tfoot id='M0OaE'></tfoot><dl id='M0OaE'><fieldset id='M0OaE'></fieldset></dl></div>
            • <small id='M0OaE'></small><noframes id='M0OaE'>

              1. <legend id='M0OaE'><style id='M0OaE'><dir id='M0OaE'><q id='M0OaE'></q></dir></style></legend>
                • 本文介绍了Visual Studio 2017 中源文件的默认编码是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  似乎 Visual Studio 2017 总是将新文件保存为 UTF8-BOM.早期版本的 Visual Studio 似乎也不是这种情况,但我找不到任何文档.

                  还有一个选项高级保存选项编码";这确实允许更改 VS2017 中缺少的新保存文件的编码.

                  问题:

                  • 在 VS2017 中是否所有文件类型都使用 UTF8-BOM 编码保存?
                  • VS2017中是否可以为新文件配置编码?
                  • VS2017 会改变旧"的编码吗?没有 UTF8-BOM 的文件?
                  • 是否有关于此主题的文档?

                  解决方案

                  还有一个选项高级保存选项编码"确实允许更改丢失的新保存文件的编码在 VS2017 中.

                  使用编码保存文件

                  1. 文件菜单中,选择将文件另存为,然后点击保存按钮旁边的下拉按钮.高级保存选项显示对话框.
                  2. 在编码下,选择文件使用的编码.
                  3. (可选)在行尾下,选择行尾的格式字符.

                  <块引用>

                  VS2017中所有文件类型都是用UTF8-BOM编码保存的吗

                  在我的例子中,VS 使用 CodePage 1252 编码存储所有文件.

                  <块引用>

                  是否可以在VS2017中为新文件配置编码

                  但是,我的 Visual Studio 版本是 15.6.1,有些人在 2017 年以前的版本中遇到了和你一样的问题,但是 他们说 "我们已经解决了这个问题,它在 Visual Studio 2017 15.3 中可用"

                  如果不工作,对于 C++ 项目请查看 /utf-8(将源和可执行字符集设置为 UTF-8).

                  <块引用>

                  VS2017 会改变旧"文件的编码吗?UTF8-BOM

                  默认情况下,Visual Studio 会检测字节顺序标记以确定源文件是否采用编码的 Unicode 格式,例如 UTF-16 或 UTF-8.如果未找到字节顺序标记,则假定源文件使用当前用户代码页进行编码,除非您使用/utf-8 或/source-charset 选项指定了代码页.有些人遇到了问题,它来自.editorconfig 文件,如下:

                  root = true[*]indent_style = 制表符缩进大小 = 4tab_width = 4trim_trailing_whitespace = trueinsert_final_newline = 真字符集 = utf-8

                  最后的 charset 行很可能会这样做...但我不是要'utf-8-with-bom'!

                  It seems Visual Studio 2017 always saves new files as UTF8-BOM. It also seems this was not the case with earlier versions of Visual Studio, but I could not find any documentation.

                  Also there has been an option "Advanced Save OptionsEncoding" which did allow to change the encoding of newly saved files which is missing in VS2017.

                  Questions:

                  • Are all file types saved with UTF8-BOM encoding in VS2017?
                  • Is it possible to configure the encoding for new files in VS2017?
                  • Will VS2017 change the encoding of "old" files which don't have UTF8-BOM?
                  • Is there any documentation about this topic?

                  解决方案

                  Also there has been an option "Advanced Save OptionsEncoding" which did allow to change the encoding of newly saved files which is missing in VS2017.

                  This feature Already exists! You can save files with specific character encoding to support bi-directional languages. You can also specify an encoding when opening a file, so that Visual Studio displays the file correctly.

                  To save a file with encoding

                  1. From the File menu, choose Save File As, and then click the drop-down button next to the Save button. The Advanced Save Options dialog box is displayed.
                  2. Under Encoding, select the encoding to use for the file.
                  3. Optionally, under Line endings, select the format for end-of-line characters.

                  Are all files types saved with UTF8-BOM encoding in VS2017

                  In my case, VS stores all the files with CodePage 1252 encoding.

                  Is it possible to configure the encoding for new files in VS2017

                  However, My Visual Studio version is 15.6.1 and some people have the same problem like yours in previous versions of 2017, but they said "We have fixed this issue and it's available in Visual Studio 2017 15.3"

                  If not working, for C++ projects Take a look at /utf-8 (Set Source and Executable character sets to UTF-8).

                  Will VS2017 change the encoding of "old" files which don't have UTF8-BOM

                  By default, Visual Studio detects a byte-order mark to determine if the source file is in an encoded Unicode format, for example, UTF-16 or UTF-8. If no byte-order mark is found, it assumes the source file is encoded using the current user code page, unless you have specified a code page by using /utf-8 or the /source-charset option. Some people encountered a problem which is came from .editorconfig file, as below:

                  root = true
                  
                  [*]
                  indent_style = tab
                  indent_size = 4
                  tab_width = 4
                  trim_trailing_whitespace = true
                  insert_final_newline = true
                  charset = utf-8 
                  

                  That final charset line is probable doing it... but I'm not asking for 'utf-8-with-bom'!

                  这篇关于Visual Studio 2017 中源文件的默认编码是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:NuGet 包显示没有依赖项? 下一篇:VS 2017 中的创建单元测试在哪里?

                  相关文章

                  <legend id='WUHWQ'><style id='WUHWQ'><dir id='WUHWQ'><q id='WUHWQ'></q></dir></style></legend>
                  • <bdo id='WUHWQ'></bdo><ul id='WUHWQ'></ul>

                      <i id='WUHWQ'><tr id='WUHWQ'><dt id='WUHWQ'><q id='WUHWQ'><span id='WUHWQ'><b id='WUHWQ'><form id='WUHWQ'><ins id='WUHWQ'></ins><ul id='WUHWQ'></ul><sub id='WUHWQ'></sub></form><legend id='WUHWQ'></legend><bdo id='WUHWQ'><pre id='WUHWQ'><center id='WUHWQ'></center></pre></bdo></b><th id='WUHWQ'></th></span></q></dt></tr></i><div id='WUHWQ'><tfoot id='WUHWQ'></tfoot><dl id='WUHWQ'><fieldset id='WUHWQ'></fieldset></dl></div>

                      <small id='WUHWQ'></small><noframes id='WUHWQ'>

                    1. <tfoot id='WUHWQ'></tfoot>