aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2024-07-08 09:35:57 -0700
committerGitHub <noreply@github.com>2024-07-08 09:35:57 -0700
commit30cc354fe37114ec7a0a4ed2192951690357c2ed (patch)
tree40e6b9dbcce249632af7f06200483ee12f1503a9 /src
parent2d42114ed1383db5b84e3c5bd5d62f3341c7ad52 (diff)
parent2039e448cf33d21de48d0f2c194e7c2b1b810eec (diff)
downloadpugixml-master.zip
pugixml-master.tar.gz
pugixml-master.tar.bz2
Merge pull request #621 from aral-matrix/masterHEADmaster
xmldocument::save: use encoding interpreted by get_write_encoding in buffered_writer constructor
Diffstat (limited to 'src')
-rw-r--r--src/pugixml.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 717fa2c..652d1e2 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -7460,7 +7460,7 @@ namespace pugi
{
impl::xml_buffered_writer buffered_writer(writer, encoding);
- if ((flags & format_write_bom) && encoding != encoding_latin1)
+ if ((flags & format_write_bom) && buffered_writer.encoding != encoding_latin1)
{
// BOM always represents the codepoint U+FEFF, so just write it in native encoding
#ifdef PUGIXML_WCHAR_MODE
@@ -7474,7 +7474,7 @@ namespace pugi
if (!(flags & format_no_declaration) && !impl::has_declaration(_root))
{
buffered_writer.write_string(PUGIXML_TEXT("<?xml version=\"1.0\""));
- if (encoding == encoding_latin1) buffered_writer.write_string(PUGIXML_TEXT(" encoding=\"ISO-8859-1\""));
+ if (buffered_writer.encoding == encoding_latin1) buffered_writer.write_string(PUGIXML_TEXT(" encoding=\"ISO-8859-1\""));
buffered_writer.write('?', '>');
if (!(flags & format_raw)) buffered_writer.write('\n');
}