Xcode - Localized.strings 不再有效

发布于 2024-08-24 06:04:24 字数 256 浏览 7 评论 0原文

我有一个 iPhone 项目,但我的英语 Localized.strings 突然不再工作了。我刚刚注意到生成的 .app-folder 中的英文 Localized.strings 文件几乎没有任何数据。从我的 3500 字节原始英文文件中,.app 中的文件为 50 字节(与 .app 中的日文文件 3000 字节相比)。

所有数据都去哪儿了?

我一直在尝试删除构建文件夹并重建所有内容,但这似乎没有帮助。日本琴弦效果很好。

可能出什么问题了?

I've got an iPhone project and my english Localizable.strings suddenly doesn't work anymore. I just noticed the english Localizable.strings file in the resulting .app-folder hardly has any data in it at all. From my 3500 bytes original english file, the one in the .app is 50 bytes (compared with the japanese which is 3000 bytes in the .app).

Where did all the data go?

I've been trying to remove the build folder and rebuilding everything, but that doesn't seem to help. The japanese strings work just fine.

What could be wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

怪异←思 2024-08-31 06:04:24

我也遇到过类似的问题,就我而言,它们与 .strings 文件的编码有关。显然 Xcode 希望它们是 UTF-16,但在某个任意应用程序中编辑它们后,它们似乎被保存为 UTF-8。

我通过在 Xcode 中打开它们,然后通过实用工具栏将编码显式设置为 UTF-16 来解决这个问题。

I have had similar issues, in my case they were related to the encoding of the .strings files. Apparently Xcode expects them to be UTF-16, but after editing them in some arbitrary app it appears they were saved as UTF-8.

I solved it by opening them in Xcode, and then via the Utilities bar explicitly setting the encoding to UTF-16.

追星践月 2024-08-31 06:04:24

英文文件中存在看不见的错误。每行都以 0xFFFE 开头,他们不应该这样做。这很棘手,因为它没有出现在我使用的任何文本编辑器中。直到我在十六进制编辑器中打开该文件后才出现(不太明显,我可能会添加:p)。我为此使用了 hex fiend

There were invisible errors in the english file. Each row started with 0xFFFE, which they supposedly shouldn't do. This was tricky as it didn't show up in any text editor I used. It wasn't until I opened the file in a hex editor that this showed up (not so obvious I might add :p). I used hex fiend for this.

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