Skip to content

Commit

Permalink
Specifies the XML encoding to be utf-8. (bakerstu#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsracz authored Jun 6, 2022
1 parent e50296c commit 2a018c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/openlcb/ConfigRenderer.cxxtest
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ TEST(CdiRender, Render)
string s;
TestCdi1 cfg(0);
cfg.config_renderer().render_cdi(&s);
const char kExpectedTestNodeCdi[] = "<?xml version=\"1.0\"?>" R"data(
const char kExpectedTestNodeCdi[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" R"data(
<cdi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://openlcb.org/schema/cdi/1/1/cdi.xsd">
<segment space='17'>
<name>testseg</name>
Expand Down Expand Up @@ -316,7 +316,7 @@ TEST(CdiRender, RenderIdent)
string s;
TestCdi2 cfg(0);
cfg.config_renderer().render_cdi(&s);
const char kExpectedTestNodeCdi[] = "<?xml version=\"1.0\"?>" R"data(
const char kExpectedTestNodeCdi[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" R"data(
<cdi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://openlcb.org/schema/cdi/1/1/cdi.xsd">
<identification>
<manufacturer>Manuf</manufacturer>
Expand Down
2 changes: 1 addition & 1 deletion src/openlcb/ConfigRenderer.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public:
*s += "<";
if (opts.is_cdi())
{
*s += "?xml version=\"1.0\"?>\n<";
*s += "?xml version=\"1.0\" encoding=\"utf-8\"?>\n<";
tag = "cdi";
*s += tag;
*s += " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
Expand Down

0 comments on commit 2a018c8

Please sign in to comment.