Localizable.strings - The data couldn’t be read because it isn’t in the correct format

前端 未结 18 1214
广开言路
广开言路 2021-01-30 06:20

If I copy something from textedit or web and paste it to localizable file it shows this compilation error. If I type those in localizable file it does not show any error. I am a

18条回答
  •  星月不相逢
    2021-01-30 06:58

    I ran into this issue, all my formatting was correct. Checking for illegal characters using plutil -lint Localizable.strings and using ruby libraries like "utf8_utils" also didn't work at finding the illegal characters. BUT when I pasted the Localizable.strings contents into the Terminal app while running irb, it did show me the weird characters.

    "PercentComplete" = "%d procent gennemført";
    

    Pasted into irb:

    "PercentComplete"\U+FFC2\U+FFA0= "%d procent gennemf\U+FFC3\U+FFB8rt";
    

    Then all I had to do was a regex replace to fix those weird white space characters: \U+FFC2\U+FFA0

提交回复
热议问题