Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

" and " are not decoded equally #184

Closed
owenzhao opened this issue May 31, 2020 · 1 comment
Closed

" and " are not decoded equally #184

owenzhao opened this issue May 31, 2020 · 1 comment

Comments

@owenzhao
Copy link
Collaborator

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 = &quot;NSButtonCell&quot;; title = &quot;Cancel&quot;; ObjectID = &quot;0uT-sC-hK8&quot;;</note>

The above is OK. As both " and &quot; 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 &quot; the string value is

"Class =\"NSButtonCell\"; title =\"Cancel\"; ObjectID =\"0uT-sC-hK8\";"

Issue

When decoding with &quot; the "space" before " is wrongly ignored, which leads the two string values are not equal.

@owenzhao
Copy link
Collaborator Author

This issue is solved by set trimValueWhitespaces to false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant