在 XCode 4 中更改源文件编码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5459700/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 20:40:34  来源:igfitidea点击:

Changing source files encoding in XCode 4

xcodeidexcode4

提问by Anton Petrov

We are developing primarily in C++ under Windows and write comments in Russian. So our OEM encoding is Cyrillic (Windows).

我们主要在 Windows 下用 C++ 开发,并用俄语写评论。所以我们的 OEM 编码是西里尔文 (Windows)。

XCode 4 does not ask to specify file encoding when you add existing file to the project. And you can specify your encoding in the right pannel on per file basis.

当您将现有文件添加到项目时,XCode 4 不会要求指定文件编码。您可以在每个文件的基础上在正确的面板中指定您的编码。

How am I supposed to change encoding for more than 200 files?

我应该如何更改 200 多个文件的编码?

Thank you.

谢谢你。

回答by tdf

Select the files (one or more) in the Project Navigator. In the Utility pane, under the Text Settings group you can change the Text Encoding.

在项目导航器中选择文件(一个或多个)。在实用程序窗格中的文本设置组下,您可以更改文本编码。

回答by Joshua Nozzi

Click the file in the Project Navigator, then open the Utility pane. Choose the File Inspector tab and look under the Text Settings group to find the Text Encoding popup.

单击 Project Navigator 中的文件,然后打开 Utility 面板。选择“文件检查器”选项卡,然后在“文本设置”组下查找“文本编码”弹出窗口。