#7519 closed Bugs (fixed)
newlines and tabs are not encoded when writing XML.
Reported by: | Owned by: | Sebastian Redl | |
---|---|---|---|
Milestone: | To Be Determined | Component: | property_tree |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | property_tree xml newline graphml | Cc: |
Description
This XML file :
<?xml version="1.0" encoding="UTF-8"?> <somemoredata>hello	world: Want something?</somemoredata>
Is properly parsed and somedata contains "hello\tworld\nWant something?", but this information is lost when writing:
<somemoredata>Hello world Want something?</somemoredata>
Reading that file will yield "Hello world Want something?", so the round trip ate these characters. Instead, write_xml should encode newlines and tabs according to http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping.
Boost.Graph's write_graphml() and read_graphml() are also affected by this problem as they reuse property_tree. The attached patch fix the problem for both libraries.
Attachments (1)
Change History (3)
by , 10 years ago
Attachment: | boost.patch added |
---|
comment:1 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed on develop in 4e7aa973f.
Merged to master in 85f8d8866ccf.
comment:2 by , 8 years ago
This patch broke my existing code. See: https://svn.boost.org/trac/boost/ticket/10338
encode \n and \t when writing XML.