diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2024-07-08 09:35:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-08 09:35:57 -0700 |
commit | 30cc354fe37114ec7a0a4ed2192951690357c2ed (patch) | |
tree | 40e6b9dbcce249632af7f06200483ee12f1503a9 /src | |
parent | 2d42114ed1383db5b84e3c5bd5d62f3341c7ad52 (diff) | |
parent | 2039e448cf33d21de48d0f2c194e7c2b1b810eec (diff) | |
download | pugixml-master.zip pugixml-master.tar.gz pugixml-master.tar.bz2 |
xmldocument::save: use encoding interpreted by get_write_encoding in buffered_writer constructor
Diffstat (limited to 'src')
-rw-r--r-- | src/pugixml.cpp | 4 |
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'); } |