Merge pull request #3721 from joshiayush:i3719

PiperOrigin-RevId: 422405356
Change-Id: I8ea22485d9a25dce81a28d0c323a73b36d15e912
pull/3735/head
Copybara-Service 3 years ago
commit c9643a2e45
  1. 7
      googletest/src/gtest.cc

@ -4079,8 +4079,9 @@ std::string XmlUnitTestResultPrinter::EscapeXml(
m << '"';
break;
default:
if (IsValidXmlCharacter(ch)) {
if (is_attribute && IsNormalizableWhitespace(ch))
if (IsValidXmlCharacter(static_cast<unsigned char>(ch))) {
if (is_attribute &&
IsNormalizableWhitespace(static_cast<unsigned char>(ch)))
m << "&#x" << String::FormatByte(static_cast<unsigned char>(ch))
<< ";";
else
@ -4101,7 +4102,7 @@ std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(
std::string output;
output.reserve(str.size());
for (std::string::const_iterator it = str.begin(); it != str.end(); ++it)
if (IsValidXmlCharacter(*it))
if (IsValidXmlCharacter(static_cast<unsigned char>(*it)))
output.push_back(*it);
return output;

Loading…
Cancel
Save