Closed owenzhao closed 4 years ago
In Xcode exported xliff file, there is an element Note, normally it will be like this.
<note>Class = "NSButtonCell"; title = "Cancel"; ObjectID = "0uT-sC-hK8";</note>
When decoded and encoded by XMLCoder, the above line would be
<note>Class = "NSButtonCell"; title = "Cancel"; ObjectID = "0uT-sC-hK8";</note>
The above is OK. As both " and \" is accepted by Xcode. However, when decoding the above two elements to String, the String results are not equal.
For the one with ", the string value is
"Class = \"NSButtonCell\"; title = \"Cancel\"; ObjectID = \"0uT-sC-hK8\";"
For the one with \" the string value is
"Class =\"NSButtonCell\"; title =\"Cancel\"; ObjectID =\"0uT-sC-hK8\";"
When decoding with \" the "space" before " is wrongly ignored, which leads the two string values are not equal.
This issue is solved by set trimValueWhitespaces to false.
trimValueWhitespaces
In Xcode exported xliff file, there is an element Note, normally it will be like this.
When decoded and encoded by XMLCoder, the above line would be
The above is OK. As both " and \" is accepted by Xcode. However, when decoding the above two elements to String, the String results are not equal.
For the one with ", the string value is
For the one with \" the string value is
Issue
When decoding with \" the "space" before " is wrongly ignored, which leads the two string values are not equal.