升级后 iphone sdk Localized.strings 文件在 xcode 4.1 中显示不正确
升级到 iphone xcode 4.1 build 4B110F 后,我的所有 localized.strings 文件在 xcode 编辑器中都显示为乱码。我使用 UTF-16 创建这些文件。我找不到办法告诉编辑它们是UTF-16。我可以通过查看属性列表来查看 Localized.strings 文件,但如果我将它们作为源代码查看,我会看到乱码。我喜欢翻译整个 localization.strings 文件并将其粘贴到编辑器中。我不想在属性编辑器中一次剪切并粘贴一行。应该有某种方法告诉 xcode 将文件显示为 UTF-16。有人有什么想法吗?
我尝试删除这些文件并重新添加它们。我曾经收到输入 UTF 类型的提示,但现在不再这样做了。
After upgrading to iphone xcode 4.1 build 4B110F all of my localizable.strings files are showing up as gibberish in the xcode editor. I created these files using UTF-16. I can not find a way to tell the editor that they are UTF-16. I am able to view the Localizable.strings files by viewing as a property list, but if I view them as Source Code, I see gibberish. I like to translate the entire localization.strings file and paste it into the editor. I don't want to have to cut and paste one line at a time in the property editor. There should be some way to tell xcode to show the file as UTF-16. Does anyone have any ideas?
I tried removing the files and re-adding them. I used to get prompted for the UTF type, but it does not do this any more.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以在 Xcode 4.1 的 Utility 区域中找到文件的文本编码设置。实用区域是右侧的横向区域。
在实用程序区域中,查找并选择名为“文件检查器”的第一个窗格。
在那里,您将在“文本设置”块中找到文本编码。如有必要,使用三角形展开。
You can find the text encoding setting for a file in the Utility area of Xcode 4.1. The utility area is the right-handside lateral area.
In the utility area, look for and select the first pane, named "File Inspector".
There, you will find the text encoding in the "Text Settings" block. Expand if necessary using the triangle.
我也有同样的问题。我能够通过简单地在 TextWrangler 中打开以前的字符串文件,然后从 TextWrangler 复制并粘贴到 XCode4 的字符串文件视图中来解决这个问题(无需进行太多实际调查)。结果,事情似乎进展顺利。
I had this same problem. I was able to work around it (without much actual investigation) by simply opening the previous string files in TextWrangler, then copy from TextWrangler and paste into XCode4's view of the string file. Things seem to be working fine as a result.
要修复 XCode 4.1 UTF-16 编码问题:
1:打开要更改的文件
2:将光标放入文件中,这将使编辑器获得焦点(非常重要)。
3:继续查看“实用程序窗格”(最右侧)下的“文本设置”,然后使用“文本编码”下拉列表选择 UTF-16 或您想要的任何其他编码。
如果您忘记了步骤 2,而仅在项目导航器中突出显示该文件,您将看不到编码选项。
To fix XCode 4.1 UTF-16 encoding issues:
1: Open the file you want to change
2: Put your cursor into the file, which will give the editor focus (VERY IMPORTANT).
3: Proceed to look under the Utilities Pane (very far right) for Text Settings and use the Text Encoding drop down to select UTF-16 or whatever other encoding you want.
If you forget step 2, and only highlight the file in the Project Navigator, you will not see encoding options.