UTF-8 中的 Localized.strings 是否有效?

发布于 2024-12-19 06:23:06 字数 265 浏览 1 评论 0原文

我正在运行 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓝颜夕 2024-12-26 06:23:07

我使用 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

此岸叶落 2024-12-26 06:23:07

我在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文