Skip to content

Commit

Permalink
add XML_ESCAPE_UNICODE
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbgan committed Apr 28, 2024
1 parent 5f0d3a1 commit 7cb6455
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions iguana/xml_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ IGUANA_INLINE void render_string_with_escape_xml(const Ch *it, SizeType length,
auto end = it;
std::advance(end, length);
while (it < end) {
#ifdef XML_ESCAPE_UNICODE
if (static_cast<unsigned>(*it) >= 0x80)
IGUANA_UNLIKELY {
write_unicode_to_string<true>(it, ss);
continue;
ss.push_back(*it);
}
else if (*it == '\'')
#endif
if (*it == '\'')
IGUANA_UNLIKELY { ss.append("&apos;"); }
else if (*it == '"')
IGUANA_UNLIKELY { ss.append("&quot;"); }
Expand Down

0 comments on commit 7cb6455

Please sign in to comment.