我使用一个localizable.strings文件,并用nslocalizedstring(@“key”,@“comment”)替换应用程序中的字符串。
到目前为止,我更换了很多弦,而且效果很好。我添加了更多的字符串,现在收到了以下错误消息:
复制文件
生成/调试iphoneos/australia.app/en.lproj/localizable.strings
en.lproj/localizable.strings光盘
/用户/regandre/desktop/xcode/australiaenit
setenv iconv/usr/bin/iconv setenv
路径
“/developer/platforms/iphoneos.platform/developer/usr/bin:/developer/usr/bin:/usr/bin:/usr/sbin:/sbin”
/developer/library/xcode/plug-ins/corebuildtasks.xcplugin/contents/resources/copystrigs
--validate--inputencoding utf-8--outputencoding binary en.lproj/localizable.strings--outdir
/用户/regisandre/desktop/xcode/australiaenit/build/debug iphoneos/australia.app/en.lproj
en.lproj/localizable.strings:
字符串转换失败。这个
字符串为空。
en.lproj/localizable.strings:
字符串转换失败。这个
字符串为空。命令
/developer/library/xcode/plug-ins/corebuildtasks.xcplugin/contents/resources/copystrigs
失败,退出代码1
更新:
你是对的!这是一个关于utf-8/utf-16编码的问题。一旦使用genstrings生成了文件,就必须避免从其他文件(甚至从xcode)复制/粘贴字符串文件,因为这会导致一些编码问题。
一旦用xcode生成了文件,所有的修改都必须通过“用keayboard直接键入”直接在文件中完成;不能复制/粘贴!(除非你确定你复制/粘贴的格式是正确的,但似乎不容易知道)