小编dut*_*hen的帖子

Localizable.strings 的字符编码,由 genstrings 生成

在我的“ViewController.swift”中,我有一个本地化的字符串:

TheOutLabel.text = NSLocalizedString("hello", comment: "The \"hello\" word")
Run Code Online (Sandbox Code Playgroud)

在终端中,为了生成“Localizable.strings”文件,我输入:

cd Base.lproj/; genstrings ../*.swift; cat Localizable.strings
Run Code Online (Sandbox Code Playgroud)

并得到以下结果:

??/* The \"hello\" word */
"hello" = "hello";
Run Code Online (Sandbox Code Playgroud)

打字时od -c Localizable.strings,我得到:

0000000  377 376   /  \0   *  \0      \0   T  \0   h  \0   e  \0      \0
0000020    \  \0   "  \0   h  \0   e  \0   l  \0   l  \0   o  \0   \  \0
0000040    "  \0      \0   w  \0   o  \0   r  \0   d  \0      \0   *  \0
0000060    /  \0  \n …
Run Code Online (Sandbox Code Playgroud)

unicode character-encoding genstrings ios swift

5
推荐指数
1
解决办法
1319
查看次数

标签 统计

character-encoding ×1

genstrings ×1

ios ×1

swift ×1

unicode ×1