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

Specifies the XML encoding to be utf-8. #625

Merged
merged 1 commit into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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