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

Value with copyright symbol © has its preceding whitespace trimmed off even trimValueWhitespaces is set to false #141

Closed
DJBen opened this issue Oct 14, 2019 · 2 comments · Fixed by #147
Assignees
Labels
bug Something isn't working

Comments

@DJBen
Copy link

DJBen commented Oct 14, 2019

See test case added in my commit that verifies this issue
82d9bac

Regardless of nested or not, parsing something like <t>Copyright © 2019 Company, Inc.</t> gets me "Copyright© 2019 Company, Inc" with the preceding whitespace before © trimmed off.

I look for the codebase and found the only place involving trimmingCharacters is in XMLStackParser:114. But later I found that the Foundation method to trim whitespace is not the culprit either.

XCTAssertEqual("Copyright © 2019 Company, Inc.".trimmingCharacters(in: .whitespacesAndNewlines), "Copyright © 2019 Company, Inc.") => true

So I am confused. Any pointer is appreciated.

@MaxDesiatov
Copy link
Collaborator

In my testing setting trimValueWhitespaces to false on a decoder in #147 fixes the issue. I agree this is unexpected behaviour, but unfortunately at this point our 0.9 release is overdue. I'll consider this a duplicate of #129 and will potentially schedule it for 0.10 timeframe. In the meantime setting trimValueWhitespaces to false is an acceptable workaround, I hope. 🤞

MaxDesiatov added a commit that referenced this issue Oct 17, 2019
Resolve #141.

* Example of wrong whitespace trimming when copyright symbol is present
* Set decoder.trimValueWhitespaces to false in test
* Move repeated string to constant
@DJBen
Copy link
Author

DJBen commented Oct 17, 2019

Okay thanks.

arjungupta0107 pushed a commit to salido/XMLCoder that referenced this issue Jun 26, 2020
Resolve CoreOffice#141.

* Example of wrong whitespace trimming when copyright symbol is present
* Set decoder.trimValueWhitespaces to false in test
* Move repeated string to constant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants