UTF-8 中的 Localized.strings 是否有效?
我正在运行 Xcode 4.3,但同样的事情也适用于 Xcode 4.2。以前,Localized.strings 文件必须采用 UTF-16 格式才能被 iOS 获取; UTF-8 字符串文件不起作用。
但今天早上,我创建了一个新的测试项目和由 XCode 以 UTF-8 创建的可本地化字符串文件。我没有立即意识到这一点,但它们确实可以工作,并且可以在模拟器、iOS 5 iPad 和 4.3 iPad 上正确使用。我的问题是,你知道这个方法从什么时候开始起作用吗?这是在某处记录的还是我搞砸了?
I am running Xcode 4.3 but the same thing works with Xcode 4.2. Previously, Localizable.strings file had to be in UTF-16 to be picked up by iOS; UTF-8 strings file did not work.
But this morning, I created a new test project and my Localizable strings files where created in UTF-8 by XCode. I did not realize it right away but they do work and are being used properly on the simulator, an iOS 5 iPad and a 4.3 iPad. My question is, do you know since when this has been working? Is this documented somewhere or do I have something messed up?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用 UTF-8 字符串文件已经有一段时间了。从来没见过问题。
但是,Apple 仍然推荐使用 UTF-16。截至 2016 年 3 月 21 日,Apple 建议使用 UTF-8
I've been using UTF-8 strings files for some time. Never seen a problem.
However, Apple does still recommend UTF-16.As of March 21, 2016, Apple recommends UTF-8
我在 Xcode 4.3.2 下为 iPhone 5.1 构建 UTF-8 字符串文件时遇到问题。
似乎翻译后的字符串中的某些字符组合(在我的例子中为“:”或“>”)导致该字符之后的所有翻译都使用代码中的字符串,而不是翻译后的字符串。
I'm having problems with UTF-8 strings files under Xcode 4.3.2 building for iPhone 5.1.
It seems certain combinations of characters ( ':' or ">" in my case ) in the translated string are causing all translations after that character to use the string in the code, not the translated string.