天天看點

Localizable.strings:0: error: read failed: The data couldn’t be read because it isn’t in the correct

在給app作本地華的時候提示很莫名的錯誤

zh-Hans.lproj/Localizable.strings:0: error: read failed: The data couldn’t be read because it isn’t in the correct format.

經查是因為在Localizable.strings的非符串中用到了全角的字元(一般是出錯最多的是等号=)空格,這一點在翻譯中文時特别容易出錯,因為經常要在全角和半角的字元進行切換,更糟糕的是xcode居然不能定位到具體出錯錯的位置,我在進行中Localizable.strings的翻譯過程用得最笨的一方法是,翻譯幾行,再編譯一下是否出錯,不要等整個檔案都翻譯完了之後再進行編譯,否剛你将會花更多的時候來查找錯誤的地方了。