encoding/xml: line endings in data get replaced #24426
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?go version go1.9.3 darwin/amd64
Does this issue reproduce with the latest release?
I created a copy of the xml package and applied the code changes of
https://go-review.googlesource.com/c/go/+/46433
which is supposed to fix issue
#20614
but the issue persists.
What did you do?
I get some xml from another service with data that contains line endings.
After parsing the data all line endings are standardized to \n.
I found this on the subject but wonder if that is supposed to even touch line endings inside CDATA. If it is just let me kindly know and I can move on to finding a workaround.
https://www.w3.org/TR/REC-xml/#sec-line-ends
Here a reproducable sample with and without CDATA escaping:
https://play.golang.org/p/PdnIyRD6Qsv
What did you expect to see?
My data with \r\n line endings intact.
What did you see instead?
My data with \n line endings.
The text was updated successfully, but these errors were encountered: