Fixed Xml encoding
- don't encode apostrophes
- only encode quotes in attributes
- encode control characters (as in PR #465)
diff --git a/include/internal/catch_xmlwriter.hpp b/include/internal/catch_xmlwriter.hpp
index 3355f4d..5f2e87e 100644
--- a/include/internal/catch_xmlwriter.hpp
+++ b/include/internal/catch_xmlwriter.hpp
@@ -14,9 +14,65 @@
 #include <sstream>
 #include <string>
 #include <vector>
+#include <iomanip>
 
 namespace Catch {
 
+    class XmlEncode {
+    public:
+        enum ForWhat { ForTextNodes, ForAttributes };
+        
+        XmlEncode( std::string const& str, ForWhat forWhat = ForTextNodes )
+        :   m_str( str ),
+            m_forWhat( forWhat )
+        {}
+        
+        void encodeTo( std::ostream& os ) const {
+
+            // Apostrophe escaping not necessary if we always use " to write attributes
+            // (see: http://www.w3.org/TR/xml/#syntax)
+            
+            for( std::size_t i = 0; i < m_str.size(); ++ i ) {
+                char c = m_str[i];
+                switch( c ) {
+                    case '<':   os << "&lt;"; break;
+                    case '&':   os << "&amp;"; break;
+                    
+                    case '>':
+                        // See: http://www.w3.org/TR/xml/#syntax
+                        if( i > 2 && m_str[i-1] == ']' && m_str[i-2] == ']' )
+                            os << "&gt;";
+                        else
+                            os << c;
+                        break;
+                        
+                    case '\"':
+                        if( m_forWhat == ForAttributes )
+                            os << "&quot;";
+                        else
+                            os << c;
+                        break;
+                        
+                    default:
+                        // Escape control chars - based on contribution by @espenalb in PR #465
+                        if ( ( c < '\x09' ) || ( c > '\x0D' && c < '\x20') || c=='\x7F' )
+                            os << "&#x" << std::uppercase << std::hex << static_cast<int>( c );
+                        else
+                            os << c;
+                }
+            }
+        }
+
+        friend std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode ) {
+            xmlEncode.encodeTo( os );
+            return os;
+        }
+        
+    private:
+        std::string m_str;
+        ForWhat m_forWhat;
+    };
+    
     class XmlWriter {
     public:
 
@@ -99,11 +155,8 @@
         }
 
         XmlWriter& writeAttribute( std::string const& name, std::string const& attribute ) {
-            if( !name.empty() && !attribute.empty() ) {
-                stream() << " " << name << "=\"";
-                writeEncodedText( attribute );
-                stream() << "\"";
-            }
+            if( !name.empty() && !attribute.empty() )
+                stream() << " " << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << "\"";
             return *this;
         }
 
@@ -114,9 +167,9 @@
 
         template<typename T>
         XmlWriter& writeAttribute( std::string const& name, T const& attribute ) {
-            if( !name.empty() )
-                stream() << " " << name << "=\"" << attribute << "\"";
-            return *this;
+            std::ostringstream oss;
+            oss << attribute;
+            return writeAttribute( name, oss.str() );
         }
 
         XmlWriter& writeText( std::string const& text, bool indent = true ) {
@@ -125,7 +178,7 @@
                 ensureTagClosed();
                 if( tagWasOpen && indent )
                     stream() << m_indent;
-                writeEncodedText( text );
+                stream() << XmlEncode( text );
                 m_needsNewline = true;
             }
             return *this;
@@ -170,30 +223,6 @@
             }
         }
 
-        void writeEncodedText( std::string const& text ) {
-            static const char* charsToEncode = "<&\"";
-            std::string mtext = text;
-            std::string::size_type pos = mtext.find_first_of( charsToEncode );
-            while( pos != std::string::npos ) {
-                stream() << mtext.substr( 0, pos );
-
-                switch( mtext[pos] ) {
-                    case '<':
-                        stream() << "&lt;";
-                        break;
-                    case '&':
-                        stream() << "&amp;";
-                        break;
-                    case '\"':
-                        stream() << "&quot;";
-                        break;
-                }
-                mtext = mtext.substr( pos+1 );
-                pos = mtext.find_first_of( charsToEncode );
-            }
-            stream() << mtext;
-        }
-
         bool m_tagIsOpen;
         bool m_needsNewline;
         std::vector<std::string> m_tags;
diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt
index 67fb843..3aa3ae8 100644
--- a/projects/SelfTest/Baselines/console.std.approved.txt
+++ b/projects/SelfTest/Baselines/console.std.approved.txt
@@ -797,6 +797,6 @@
   "first" == "second"
 
 ===============================================================================
-test cases: 157 | 117 passed | 39 failed |  1 failed as expected
-assertions: 773 | 680 passed | 80 failed | 13 failed as expected
+test cases: 158 | 118 passed | 39 failed |  1 failed as expected
+assertions: 783 | 690 passed | 80 failed | 13 failed as expected
 
diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt
index 7d41c5a..238450b 100644
--- a/projects/SelfTest/Baselines/console.sw.approved.txt
+++ b/projects/SelfTest/Baselines/console.sw.approved.txt
@@ -3763,6 +3763,128 @@
   ""wide load"" == ""wide load""
 
 -------------------------------------------------------------------------------
+XmlEncode
+  normal string
+-------------------------------------------------------------------------------
+MiscTests.cpp:<line number>
+...............................................................................
+
+MiscTests.cpp:<line number>:
+PASSED:
+  REQUIRE( encode( "normal string" ) == "normal string" )
+with expansion:
+  "normal string" == "normal string"
+
+-------------------------------------------------------------------------------
+XmlEncode
+  empty string
+-------------------------------------------------------------------------------
+MiscTests.cpp:<line number>
+...............................................................................
+
+MiscTests.cpp:<line number>:
+PASSED:
+  REQUIRE( encode( "" ) == "" )
+with expansion:
+  "" == ""
+
+-------------------------------------------------------------------------------
+XmlEncode
+  string with ampersand
+-------------------------------------------------------------------------------
+MiscTests.cpp:<line number>
+...............................................................................
+
+MiscTests.cpp:<line number>:
+PASSED:
+  REQUIRE( encode( "smith & jones" ) == "smith &amp; jones" )
+with expansion:
+  "smith &amp; jones" == "smith &amp; jones"
+
+-------------------------------------------------------------------------------
+XmlEncode
+  string with less-than
+-------------------------------------------------------------------------------
+MiscTests.cpp:<line number>
+...............................................................................
+
+MiscTests.cpp:<line number>:
+PASSED:
+  REQUIRE( encode( "smith < jones" ) == "smith &lt; jones" )
+with expansion:
+  "smith &lt; jones" == "smith &lt; jones"
+
+-------------------------------------------------------------------------------
+XmlEncode
+  string with greater-than
+-------------------------------------------------------------------------------
+MiscTests.cpp:<line number>
+...............................................................................
+
+MiscTests.cpp:<line number>:
+PASSED:
+  REQUIRE( encode( "smith > jones" ) == "smith > jones" )
+with expansion:
+  "smith > jones" == "smith > jones"
+
+MiscTests.cpp:<line number>:
+PASSED:
+  REQUIRE( encode( "smith ]]> jones" ) == "smith ]]&gt; jones" )
+with expansion:
+  "smith ]]&gt; jones"
+  ==
+  "smith ]]&gt; jones"
+
+-------------------------------------------------------------------------------
+XmlEncode
+  string with quotes
+-------------------------------------------------------------------------------
+MiscTests.cpp:<line number>
+...............................................................................
+
+MiscTests.cpp:<line number>:
+PASSED:
+  REQUIRE( encode( stringWithQuotes ) == stringWithQuotes )
+with expansion:
+  "don't "quote" me on that"
+  ==
+  "don't "quote" me on that"
+
+MiscTests.cpp:<line number>:
+PASSED:
+  REQUIRE( encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't &quot;quote&quot; me on that" )
+with expansion:
+  "don't &quot;quote&quot; me on that"
+  ==
+  "don't &quot;quote&quot; me on that"
+
+-------------------------------------------------------------------------------
+XmlEncode
+  string with control char (1)
+-------------------------------------------------------------------------------
+MiscTests.cpp:<line number>
+...............................................................................
+
+MiscTests.cpp:<line number>:
+PASSED:
+  REQUIRE( encode( "[\x01]" ) == "[&#x1]" )
+with expansion:
+  "[&#x1]" == "[&#x1]"
+
+-------------------------------------------------------------------------------
+XmlEncode
+  string with control char (x7F)
+-------------------------------------------------------------------------------
+MiscTests.cpp:<line number>
+...............................................................................
+
+MiscTests.cpp:<line number>:
+PASSED:
+  REQUIRE( encode( "[\x7F]" ) == "[&#x7F]" )
+with expansion:
+  "[&#x7F]" == "[&#x7F]"
+
+-------------------------------------------------------------------------------
 Process can be configured on command line
   default - no arguments
 -------------------------------------------------------------------------------
@@ -8004,6 +8126,6 @@
   true
 
 ===============================================================================
-test cases: 157 | 101 passed |  55 failed |  1 failed as expected
-assertions: 793 | 680 passed | 100 failed | 13 failed as expected
+test cases: 158 | 102 passed |  55 failed |  1 failed as expected
+assertions: 803 | 690 passed | 100 failed | 13 failed as expected
 
diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt
index cd978bf..deae752 100644
--- a/projects/SelfTest/Baselines/junit.sw.approved.txt
+++ b/projects/SelfTest/Baselines/junit.sw.approved.txt
@@ -1,5 +1,5 @@
 <testsuites>
-  <testsuite name="all tests" errors="12" failures="88" tests="793" hostname="tbd" time="{duration}" timestamp="tbd">
+  <testsuite name="all tests" errors="12" failures="88" tests="803" hostname="tbd" time="{duration}" timestamp="tbd">
     <testcase classname="global" name="toString(enum)" time="{duration}"/>
     <testcase classname="global" name="toString(enum w/operator&lt;&lt;)" time="{duration}"/>
     <testcase classname="global" name="toString(enum class)" time="{duration}"/>
@@ -463,6 +463,14 @@
     <testcase classname="global" name="toString on const wchar_t pointer returns the string contents" time="{duration}"/>
     <testcase classname="global" name="toString on wchar_t const pointer returns the string contents" time="{duration}"/>
     <testcase classname="global" name="toString on wchar_t returns the string contents" time="{duration}"/>
+    <testcase classname="XmlEncode" name="normal string" time="{duration}"/>
+    <testcase classname="XmlEncode" name="empty string" time="{duration}"/>
+    <testcase classname="XmlEncode" name="string with ampersand" time="{duration}"/>
+    <testcase classname="XmlEncode" name="string with less-than" time="{duration}"/>
+    <testcase classname="XmlEncode" name="string with greater-than" time="{duration}"/>
+    <testcase classname="XmlEncode" name="string with quotes" time="{duration}"/>
+    <testcase classname="XmlEncode" name="string with control char (1)" time="{duration}"/>
+    <testcase classname="XmlEncode" name="string with control char (x7F)" time="{duration}"/>
     <testcase classname="Process can be configured on command line" name="default - no arguments" time="{duration}"/>
     <testcase classname="Process can be configured on command line" name="test lists/1 test" time="{duration}"/>
     <testcase classname="Process can be configured on command line" name="test lists/Specify one test case exclusion using exclude:" time="{duration}"/>
diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt
index 654061f..10b826c 100644
--- a/projects/SelfTest/Baselines/xml.sw.approved.txt
+++ b/projects/SelfTest/Baselines/xml.sw.approved.txt
@@ -3,18 +3,18 @@
     <TestCase name="toString(enum)">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
         <Original>
-          Catch::toString(e0) == &quot;0&quot;
+          Catch::toString(e0) == "0"
         </Original>
         <Expanded>
-          &quot;0&quot; == &quot;0&quot;
+          "0" == "0"
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
         <Original>
-          Catch::toString(e1) == &quot;1&quot;
+          Catch::toString(e1) == "1"
         </Original>
         <Expanded>
-          &quot;1&quot; == &quot;1&quot;
+          "1" == "1"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -22,18 +22,18 @@
     <TestCase name="toString(enum w/operator&lt;&lt;)">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
         <Original>
-          Catch::toString(e0) == &quot;E2{0}&quot;
+          Catch::toString(e0) == "E2{0}"
         </Original>
         <Expanded>
-          &quot;E2{0}&quot; == &quot;E2{0}&quot;
+          "E2{0}" == "E2{0}"
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
         <Original>
-          Catch::toString(e1) == &quot;E2{1}&quot;
+          Catch::toString(e1) == "E2{1}"
         </Original>
         <Expanded>
-          &quot;E2{1}&quot; == &quot;E2{1}&quot;
+          "E2{1}" == "E2{1}"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -41,18 +41,18 @@
     <TestCase name="toString(enum class)">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
         <Original>
-          Catch::toString(e0) == &quot;0&quot;
+          Catch::toString(e0) == "0"
         </Original>
         <Expanded>
-          &quot;0&quot; == &quot;0&quot;
+          "0" == "0"
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
         <Original>
-          Catch::toString(e1) == &quot;1&quot;
+          Catch::toString(e1) == "1"
         </Original>
         <Expanded>
-          &quot;1&quot; == &quot;1&quot;
+          "1" == "1"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -60,28 +60,28 @@
     <TestCase name="toString(enum class w/operator&lt;&lt;)">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
         <Original>
-          Catch::toString(e0) == &quot;E2/V0&quot;
+          Catch::toString(e0) == "E2/V0"
         </Original>
         <Expanded>
-          &quot;E2/V0&quot; == &quot;E2/V0&quot;
+          "E2/V0" == "E2/V0"
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
         <Original>
-          Catch::toString(e1) == &quot;E2/V1&quot;
+          Catch::toString(e1) == "E2/V1"
         </Original>
         <Expanded>
-          &quot;E2/V1&quot; == &quot;E2/V1&quot;
+          "E2/V1" == "E2/V1"
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
         <Original>
-          Catch::toString(e3) == &quot;Unknown enum value 10&quot;
+          Catch::toString(e3) == "Unknown enum value 10"
         </Original>
         <Expanded>
-          &quot;Unknown enum value 10&quot;
+          "Unknown enum value 10"
 ==
-&quot;Unknown enum value 10&quot;
+"Unknown enum value 10"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -326,10 +326,10 @@
     <TestCase name="A METHOD_AS_TEST_CASE based test run that succeeds">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ClassTests.cpp" >
         <Original>
-          s == &quot;hello&quot;
+          s == "hello"
         </Original>
         <Expanded>
-          &quot;hello&quot; == &quot;hello&quot;
+          "hello" == "hello"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -337,10 +337,10 @@
     <TestCase name="A METHOD_AS_TEST_CASE based test run that fails">
       <Expression success="false" type="REQUIRE" filename="projects/SelfTest/ClassTests.cpp" >
         <Original>
-          s == &quot;world&quot;
+          s == "world"
         </Original>
         <Expanded>
-          &quot;hello&quot; == &quot;world&quot;
+          "hello" == "world"
         </Expanded>
       </Expression>
       <OverallResult success="false"/>
@@ -394,18 +394,18 @@
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello == &quot;hello&quot;
+          data.str_hello == "hello"
         </Original>
         <Expanded>
-          &quot;hello&quot; == &quot;hello&quot;
+          "hello" == "hello"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          &quot;hello&quot; == data.str_hello
+          "hello" == data.str_hello
         </Original>
         <Expanded>
-          &quot;hello&quot; == &quot;hello&quot;
+          "hello" == "hello"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
@@ -493,26 +493,26 @@
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello == &quot;goodbye&quot;
+          data.str_hello == "goodbye"
         </Original>
         <Expanded>
-          &quot;hello&quot; == &quot;goodbye&quot;
+          "hello" == "goodbye"
         </Expanded>
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello == &quot;hell&quot;
+          data.str_hello == "hell"
         </Original>
         <Expanded>
-          &quot;hello&quot; == &quot;hell&quot;
+          "hello" == "hell"
         </Expanded>
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello == &quot;hello1&quot;
+          data.str_hello == "hello1"
         </Original>
         <Expanded>
-          &quot;hello&quot; == &quot;hello1&quot;
+          "hello" == "hello1"
         </Expanded>
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
@@ -592,26 +592,26 @@
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello != &quot;goodbye&quot;
+          data.str_hello != "goodbye"
         </Original>
         <Expanded>
-          &quot;hello&quot; != &quot;goodbye&quot;
+          "hello" != "goodbye"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello != &quot;hell&quot;
+          data.str_hello != "hell"
         </Original>
         <Expanded>
-          &quot;hello&quot; != &quot;hell&quot;
+          "hello" != "hell"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello != &quot;hello1&quot;
+          data.str_hello != "hello1"
         </Original>
         <Expanded>
-          &quot;hello&quot; != &quot;hello1&quot;
+          "hello" != "hello1"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
@@ -651,10 +651,10 @@
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello != &quot;hello&quot;
+          data.str_hello != "hello"
         </Original>
         <Expanded>
-          &quot;hello&quot; != &quot;hello&quot;
+          "hello" != "hello"
         </Expanded>
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
@@ -758,50 +758,50 @@
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello &lt;= &quot;hello&quot;
+          data.str_hello &lt;= "hello"
         </Original>
         <Expanded>
-          &quot;hello&quot; &lt;= &quot;hello&quot;
+          "hello" &lt;= "hello"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello >= &quot;hello&quot;
+          data.str_hello >= "hello"
         </Original>
         <Expanded>
-          &quot;hello&quot; >= &quot;hello&quot;
+          "hello" >= "hello"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello &lt; &quot;hellp&quot;
+          data.str_hello &lt; "hellp"
         </Original>
         <Expanded>
-          &quot;hello&quot; &lt; &quot;hellp&quot;
+          "hello" &lt; "hellp"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello &lt; &quot;zebra&quot;
+          data.str_hello &lt; "zebra"
         </Original>
         <Expanded>
-          &quot;hello&quot; &lt; &quot;zebra&quot;
+          "hello" &lt; "zebra"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello > &quot;hellm&quot;
+          data.str_hello > "hellm"
         </Original>
         <Expanded>
-          &quot;hello&quot; > &quot;hellm&quot;
+          "hello" > "hellm"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello > &quot;a&quot;
+          data.str_hello > "a"
         </Original>
         <Expanded>
-          &quot;hello&quot; > &quot;a&quot;
+          "hello" > "a"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -897,66 +897,66 @@
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello > &quot;hello&quot;
+          data.str_hello > "hello"
         </Original>
         <Expanded>
-          &quot;hello&quot; > &quot;hello&quot;
+          "hello" > "hello"
         </Expanded>
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello &lt; &quot;hello&quot;
+          data.str_hello &lt; "hello"
         </Original>
         <Expanded>
-          &quot;hello&quot; &lt; &quot;hello&quot;
+          "hello" &lt; "hello"
         </Expanded>
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello > &quot;hellp&quot;
+          data.str_hello > "hellp"
         </Original>
         <Expanded>
-          &quot;hello&quot; > &quot;hellp&quot;
+          "hello" > "hellp"
         </Expanded>
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello > &quot;z&quot;
+          data.str_hello > "z"
         </Original>
         <Expanded>
-          &quot;hello&quot; > &quot;z&quot;
+          "hello" > "z"
         </Expanded>
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello &lt; &quot;hellm&quot;
+          data.str_hello &lt; "hellm"
         </Original>
         <Expanded>
-          &quot;hello&quot; &lt; &quot;hellm&quot;
+          "hello" &lt; "hellm"
         </Expanded>
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello &lt; &quot;a&quot;
+          data.str_hello &lt; "a"
         </Original>
         <Expanded>
-          &quot;hello&quot; &lt; &quot;a&quot;
+          "hello" &lt; "a"
         </Expanded>
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello >= &quot;z&quot;
+          data.str_hello >= "z"
         </Original>
         <Expanded>
-          &quot;hello&quot; >= &quot;z&quot;
+          "hello" >= "z"
         </Expanded>
       </Expression>
       <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
         <Original>
-          data.str_hello &lt;= &quot;a&quot;
+          data.str_hello &lt;= "a"
         </Original>
         <Expanded>
-          &quot;hello&quot; &lt;= &quot;a&quot;
+          "hello" &lt;= "a"
         </Expanded>
       </Expression>
       <OverallResult success="false"/>
@@ -1600,10 +1600,10 @@
       <Section name="exact match">
         <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
           <Original>
-            thisThrows(), &quot;expected exception&quot;
+            thisThrows(), "expected exception"
           </Original>
           <Expanded>
-            thisThrows(), &quot;expected exception&quot;
+            thisThrows(), "expected exception"
           </Expanded>
         </Expression>
         <OverallResults successes="1" failures="0" expectedFailures="0"/>
@@ -1611,10 +1611,10 @@
       <Section name="different case">
         <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
           <Original>
-            thisThrows(), Equals( &quot;expecteD Exception&quot;, Catch::CaseSensitive::No )
+            thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No )
           </Original>
           <Expanded>
-            thisThrows(), Equals( &quot;expecteD Exception&quot;, Catch::CaseSensitive::No )
+            thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No )
           </Expanded>
         </Expression>
         <OverallResults successes="1" failures="0" expectedFailures="0"/>
@@ -1622,34 +1622,34 @@
       <Section name="wildcarded">
         <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
           <Original>
-            thisThrows(), StartsWith( &quot;expected&quot; )
+            thisThrows(), StartsWith( "expected" )
           </Original>
           <Expanded>
-            thisThrows(), StartsWith( &quot;expected&quot; )
+            thisThrows(), StartsWith( "expected" )
           </Expanded>
         </Expression>
         <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
           <Original>
-            thisThrows(), EndsWith( &quot;exception&quot; )
+            thisThrows(), EndsWith( "exception" )
           </Original>
           <Expanded>
-            thisThrows(), EndsWith( &quot;exception&quot; )
+            thisThrows(), EndsWith( "exception" )
           </Expanded>
         </Expression>
         <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
           <Original>
-            thisThrows(), Contains( &quot;except&quot; )
+            thisThrows(), Contains( "except" )
           </Original>
           <Expanded>
-            thisThrows(), Contains( &quot;except&quot; )
+            thisThrows(), Contains( "except" )
           </Expanded>
         </Expression>
         <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
           <Original>
-            thisThrows(), Contains( &quot;exCept&quot;, Catch::CaseSensitive::No )
+            thisThrows(), Contains( "exCept", Catch::CaseSensitive::No )
           </Original>
           <Expanded>
-            thisThrows(), Contains( &quot;exCept&quot;, Catch::CaseSensitive::No )
+            thisThrows(), Contains( "exCept", Catch::CaseSensitive::No )
           </Expanded>
         </Expression>
         <OverallResults successes="4" failures="0" expectedFailures="0"/>
@@ -1659,15 +1659,15 @@
     <TestCase name="Mismatching exception messages failing the test">
       <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
         <Original>
-          thisThrows(), &quot;expected exception&quot;
+          thisThrows(), "expected exception"
         </Original>
         <Expanded>
-          thisThrows(), &quot;expected exception&quot;
+          thisThrows(), "expected exception"
         </Expanded>
       </Expression>
       <Expression success="false" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
         <Original>
-          thisThrows(), &quot;should fail&quot;
+          thisThrows(), "should fail"
         </Original>
         <Expanded>
           expected exception
@@ -3308,7 +3308,7 @@
           makeString( false ) != static_cast&lt;char*>(nullptr)
         </Original>
         <Expanded>
-          &quot;valid string&quot; != {null string}
+          "valid string" != {null string}
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/MiscTests.cpp" >
@@ -3434,34 +3434,34 @@
     <TestCase name="String matchers">
       <Expression success="true" type="REQUIRE_THAT" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          testStringForMatching() Contains( &quot;string&quot; )
+          testStringForMatching() Contains( "string" )
         </Original>
         <Expanded>
-          &quot;this string contains 'abc' as a substring&quot; contains: &quot;string&quot;
+          "this string contains 'abc' as a substring" contains: "string"
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          testStringForMatching() Contains( &quot;abc&quot; )
+          testStringForMatching() Contains( "abc" )
         </Original>
         <Expanded>
-          &quot;this string contains 'abc' as a substring&quot; contains: &quot;abc&quot;
+          "this string contains 'abc' as a substring" contains: "abc"
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          testStringForMatching() StartsWith( &quot;this&quot; )
+          testStringForMatching() StartsWith( "this" )
         </Original>
         <Expanded>
-          &quot;this string contains 'abc' as a substring&quot; starts with: &quot;this&quot;
+          "this string contains 'abc' as a substring" starts with: "this"
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          testStringForMatching() EndsWith( &quot;substring&quot; )
+          testStringForMatching() EndsWith( "substring" )
         </Original>
         <Expanded>
-          &quot;this string contains 'abc' as a substring&quot; ends with: &quot;substring&quot;
+          "this string contains 'abc' as a substring" ends with: "substring"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -3469,10 +3469,10 @@
     <TestCase name="Contains string matcher">
       <Expression success="false" type="CHECK_THAT" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          testStringForMatching() Contains( &quot;not there&quot; )
+          testStringForMatching() Contains( "not there" )
         </Original>
         <Expanded>
-          &quot;this string contains 'abc' as a substring&quot; contains: &quot;not there&quot;
+          "this string contains 'abc' as a substring" contains: "not there"
         </Expanded>
       </Expression>
       <OverallResult success="false"/>
@@ -3480,10 +3480,10 @@
     <TestCase name="StartsWith string matcher">
       <Expression success="false" type="CHECK_THAT" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          testStringForMatching() StartsWith( &quot;string&quot; )
+          testStringForMatching() StartsWith( "string" )
         </Original>
         <Expanded>
-          &quot;this string contains 'abc' as a substring&quot; starts with: &quot;string&quot;
+          "this string contains 'abc' as a substring" starts with: "string"
         </Expanded>
       </Expression>
       <OverallResult success="false"/>
@@ -3491,10 +3491,10 @@
     <TestCase name="EndsWith string matcher">
       <Expression success="false" type="CHECK_THAT" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          testStringForMatching() EndsWith( &quot;this&quot; )
+          testStringForMatching() EndsWith( "this" )
         </Original>
         <Expanded>
-          &quot;this string contains 'abc' as a substring&quot; ends with: &quot;this&quot;
+          "this string contains 'abc' as a substring" ends with: "this"
         </Expanded>
       </Expression>
       <OverallResult success="false"/>
@@ -3502,10 +3502,10 @@
     <TestCase name="Equals string matcher">
       <Expression success="false" type="CHECK_THAT" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          testStringForMatching() Equals( &quot;something else&quot; )
+          testStringForMatching() Equals( "something else" )
         </Original>
         <Expanded>
-          &quot;this string contains 'abc' as a substring&quot; equals: &quot;something else&quot;
+          "this string contains 'abc' as a substring" equals: "something else"
         </Expanded>
       </Expression>
       <OverallResult success="false"/>
@@ -3513,10 +3513,10 @@
     <TestCase name="Equals string matcher, with NULL">
       <Expression success="true" type="REQUIRE_THAT" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          &quot;&quot; Equals(nullptr)
+          "" Equals(nullptr)
         </Original>
         <Expanded>
-          &quot;&quot; equals: &quot;&quot;
+          "" equals: ""
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -3524,10 +3524,10 @@
     <TestCase name="AllOf matcher">
       <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          testStringForMatching() AllOf( Catch::Contains( &quot;string&quot; ), Catch::Contains( &quot;abc&quot; ) )
+          testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) )
         </Original>
         <Expanded>
-          &quot;this string contains 'abc' as a substring&quot; ( contains: &quot;string&quot; and contains: &quot;abc&quot; )
+          "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" )
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -3535,18 +3535,18 @@
     <TestCase name="AnyOf matcher">
       <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          testStringForMatching() AnyOf( Catch::Contains( &quot;string&quot; ), Catch::Contains( &quot;not there&quot; ) )
+          testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) )
         </Original>
         <Expanded>
-          &quot;this string contains 'abc' as a substring&quot; ( contains: &quot;string&quot; or contains: &quot;not there&quot; )
+          "this string contains 'abc' as a substring" ( contains: "string" or contains: "not there" )
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          testStringForMatching() AnyOf( Catch::Contains( &quot;not there&quot; ), Catch::Contains( &quot;string&quot; ) )
+          testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) )
         </Original>
         <Expanded>
-          &quot;this string contains 'abc' as a substring&quot; ( contains: &quot;not there&quot; or contains: &quot;string&quot; )
+          "this string contains 'abc' as a substring" ( contains: "not there" or contains: "string" )
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -3554,10 +3554,10 @@
     <TestCase name="Equals">
       <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          testStringForMatching() Equals( &quot;this string contains 'abc' as a substring&quot; )
+          testStringForMatching() Equals( "this string contains 'abc' as a substring" )
         </Original>
         <Expanded>
-          &quot;this string contains 'abc' as a substring&quot; equals: &quot;this string contains 'abc' as a substring&quot;
+          "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -3795,14 +3795,14 @@
           s1 == s2
         </Original>
         <Expanded>
-          &quot;if ($b == 10) {
+          "if ($b == 10) {
 		$a	= 20;
-}&quot;
+}"
 ==
-&quot;if ($b == 10) {
+"if ($b == 10) {
 	$a = 20;
 }
-&quot;
+"
         </Expanded>
       </Expression>
       <OverallResult success="false"/>
@@ -3810,10 +3810,10 @@
     <TestCase name="toString on const wchar_t const pointer returns the string contents">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          result == &quot;\&quot;wide load\&quot;&quot;
+          result == "\"wide load\""
         </Original>
         <Expanded>
-          &quot;&quot;wide load&quot;&quot; == &quot;&quot;wide load&quot;&quot;
+          ""wide load"" == ""wide load""
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -3821,10 +3821,10 @@
     <TestCase name="toString on const wchar_t pointer returns the string contents">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          result == &quot;\&quot;wide load\&quot;&quot;
+          result == "\"wide load\""
         </Original>
         <Expanded>
-          &quot;&quot;wide load&quot;&quot; == &quot;&quot;wide load&quot;&quot;
+          ""wide load"" == ""wide load""
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -3832,10 +3832,10 @@
     <TestCase name="toString on wchar_t const pointer returns the string contents">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          result == &quot;\&quot;wide load\&quot;&quot;
+          result == "\"wide load\""
         </Original>
         <Expanded>
-          &quot;&quot;wide load&quot;&quot; == &quot;&quot;wide load&quot;&quot;
+          ""wide load"" == ""wide load""
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -3843,14 +3843,127 @@
     <TestCase name="toString on wchar_t returns the string contents">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/MiscTests.cpp" >
         <Original>
-          result == &quot;\&quot;wide load\&quot;&quot;
+          result == "\"wide load\""
         </Original>
         <Expanded>
-          &quot;&quot;wide load&quot;&quot; == &quot;&quot;wide load&quot;&quot;
+          ""wide load"" == ""wide load""
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
     </TestCase>
+    <TestCase name="XmlEncode">
+      <Section name="normal string">
+        <Expression success="true" type="REQUIRE" filename="projects/SelfTest/MiscTests.cpp" >
+          <Original>
+            encode( "normal string" ) == "normal string"
+          </Original>
+          <Expanded>
+            "normal string" == "normal string"
+          </Expanded>
+        </Expression>
+        <OverallResults successes="1" failures="0" expectedFailures="0"/>
+      </Section>
+      <Section name="empty string">
+        <Expression success="true" type="REQUIRE" filename="projects/SelfTest/MiscTests.cpp" >
+          <Original>
+            encode( "" ) == ""
+          </Original>
+          <Expanded>
+            "" == ""
+          </Expanded>
+        </Expression>
+        <OverallResults successes="1" failures="0" expectedFailures="0"/>
+      </Section>
+      <Section name="string with ampersand">
+        <Expression success="true" type="REQUIRE" filename="projects/SelfTest/MiscTests.cpp" >
+          <Original>
+            encode( "smith &amp; jones" ) == "smith &amp;amp; jones"
+          </Original>
+          <Expanded>
+            "smith &amp;amp; jones" == "smith &amp;amp; jones"
+          </Expanded>
+        </Expression>
+        <OverallResults successes="1" failures="0" expectedFailures="0"/>
+      </Section>
+      <Section name="string with less-than">
+        <Expression success="true" type="REQUIRE" filename="projects/SelfTest/MiscTests.cpp" >
+          <Original>
+            encode( "smith &lt; jones" ) == "smith &amp;lt; jones"
+          </Original>
+          <Expanded>
+            "smith &amp;lt; jones" == "smith &amp;lt; jones"
+          </Expanded>
+        </Expression>
+        <OverallResults successes="1" failures="0" expectedFailures="0"/>
+      </Section>
+      <Section name="string with greater-than">
+        <Expression success="true" type="REQUIRE" filename="projects/SelfTest/MiscTests.cpp" >
+          <Original>
+            encode( "smith > jones" ) == "smith > jones"
+          </Original>
+          <Expanded>
+            "smith > jones" == "smith > jones"
+          </Expanded>
+        </Expression>
+        <Expression success="true" type="REQUIRE" filename="projects/SelfTest/MiscTests.cpp" >
+          <Original>
+            encode( "smith ]]&gt; jones" ) == "smith ]]&amp;gt; jones"
+          </Original>
+          <Expanded>
+            "smith ]]&amp;gt; jones"
+==
+"smith ]]&amp;gt; jones"
+          </Expanded>
+        </Expression>
+        <OverallResults successes="2" failures="0" expectedFailures="0"/>
+      </Section>
+      <Section name="string with quotes">
+        <Expression success="true" type="REQUIRE" filename="projects/SelfTest/MiscTests.cpp" >
+          <Original>
+            encode( stringWithQuotes ) == stringWithQuotes
+          </Original>
+          <Expanded>
+            "don't "quote" me on that"
+==
+"don't "quote" me on that"
+          </Expanded>
+        </Expression>
+        <Expression success="true" type="REQUIRE" filename="projects/SelfTest/MiscTests.cpp" >
+          <Original>
+            encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't &amp;quot;quote&amp;quot; me on that"
+          </Original>
+          <Expanded>
+            "don't &amp;quot;quote&amp;quot; me on that"
+==
+"don't &amp;quot;quote&amp;quot; me on that"
+          </Expanded>
+        </Expression>
+        <OverallResults successes="2" failures="0" expectedFailures="0"/>
+      </Section>
+      <Section name="string with control char (1)">
+        <Expression success="true" type="REQUIRE" filename="projects/SelfTest/MiscTests.cpp" >
+          <Original>
+            encode( "[\x01]" ) == "[&amp;#x1]"
+          </Original>
+          <Expanded>
+            "[&amp;#x1]" == "[&amp;#x1]"
+          </Expanded>
+        </Expression>
+        <OverallResults successes="1" failures="0" expectedFailures="0"/>
+      </Section>
+      <Section name="string with control char (x7F)">
+        <Expression success="true" type="REQUIRE" filename="projects/SelfTest/MiscTests.cpp" >
+          <Original>
+            encode( "[\x7F]" ) == "[&amp;#x7F]"
+          </Original>
+          <Expanded>
+            "[&amp;#x7F]" == "[&amp;#x7F]"
+          </Expanded>
+        </Expression>
+        <OverallResults successes="1" failures="0" expectedFailures="0"/>
+      </Section>
+      <OverallResult success="true"/>
+    </TestCase>
     <TestCase name="Process can be configured on command line">
       <Section name="default - no arguments">
         <Expression success="true" type="CHECK_NOTHROW" filename="projects/SelfTest/TestMain.cpp" >
@@ -3907,7 +4020,7 @@
           </Expression>
           <Expression success="true" type="REQUIRE" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              cfg.testSpec().matches( fakeTestCase( &quot;notIncluded&quot; ) ) == false
+              cfg.testSpec().matches( fakeTestCase( "notIncluded" ) ) == false
             </Original>
             <Expanded>
               false == false
@@ -3915,7 +4028,7 @@
           </Expression>
           <Expression success="true" type="REQUIRE" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              cfg.testSpec().matches( fakeTestCase( &quot;test1&quot; ) )
+              cfg.testSpec().matches( fakeTestCase( "test1" ) )
             </Original>
             <Expanded>
               true
@@ -3937,7 +4050,7 @@
           </Expression>
           <Expression success="true" type="REQUIRE" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              cfg.testSpec().matches( fakeTestCase( &quot;test1&quot; ) ) == false
+              cfg.testSpec().matches( fakeTestCase( "test1" ) ) == false
             </Original>
             <Expanded>
               false == false
@@ -3945,7 +4058,7 @@
           </Expression>
           <Expression success="true" type="REQUIRE" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              cfg.testSpec().matches( fakeTestCase( &quot;alwaysIncluded&quot; ) )
+              cfg.testSpec().matches( fakeTestCase( "alwaysIncluded" ) )
             </Original>
             <Expanded>
               true
@@ -3967,7 +4080,7 @@
           </Expression>
           <Expression success="true" type="REQUIRE" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              cfg.testSpec().matches( fakeTestCase( &quot;test1&quot; ) ) == false
+              cfg.testSpec().matches( fakeTestCase( "test1" ) ) == false
             </Original>
             <Expanded>
               false == false
@@ -3975,7 +4088,7 @@
           </Expression>
           <Expression success="true" type="REQUIRE" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              cfg.testSpec().matches( fakeTestCase( &quot;alwaysIncluded&quot; ) )
+              cfg.testSpec().matches( fakeTestCase( "alwaysIncluded" ) )
             </Original>
             <Expanded>
               true
@@ -3997,10 +4110,10 @@
           </Expression>
           <Expression success="true" type="REQUIRE" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              config.reporterName == &quot;console&quot;
+              config.reporterName == "console"
             </Original>
             <Expanded>
-              &quot;console&quot; == &quot;console&quot;
+              "console" == "console"
             </Expanded>
           </Expression>
           <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4019,10 +4132,10 @@
           </Expression>
           <Expression success="true" type="REQUIRE" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              config.reporterName == &quot;xml&quot;
+              config.reporterName == "xml"
             </Original>
             <Expanded>
-              &quot;xml&quot; == &quot;xml&quot;
+              "xml" == "xml"
             </Expanded>
           </Expression>
           <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4041,10 +4154,10 @@
           </Expression>
           <Expression success="true" type="REQUIRE" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              config.reporterName == &quot;junit&quot;
+              config.reporterName == "junit"
             </Original>
             <Expanded>
-              &quot;junit&quot; == &quot;junit&quot;
+              "junit" == "junit"
             </Expanded>
           </Expression>
           <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4143,11 +4256,11 @@
         <Section name="-x must be greater than zero">
           <Expression success="true" type="REQUIRE_THAT" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              parseIntoConfigAndReturnError( argv, config ) Contains( &quot;greater than zero&quot; )
+              parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" )
             </Original>
             <Expanded>
-              &quot;Value after -x or --abortAfter must be greater than zero
-- while parsing: (-x, --abortx &lt;no. failures>)&quot; contains: &quot;greater than zero&quot;
+              "Value after -x or --abortAfter must be greater than zero
+- while parsing: (-x, --abortx &lt;no. failures>)" contains: "greater than zero"
             </Expanded>
           </Expression>
           <OverallResults successes="1" failures="0" expectedFailures="0"/>
@@ -4158,11 +4271,11 @@
         <Section name="-x must be numeric">
           <Expression success="true" type="REQUIRE_THAT" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              parseIntoConfigAndReturnError( argv, config ) Contains( &quot;-x&quot; )
+              parseIntoConfigAndReturnError( argv, config ) Contains( "-x" )
             </Original>
             <Expanded>
-              &quot;Unable to convert oops to destination type
-- while parsing: (-x, --abortx &lt;no. failures>)&quot; contains: &quot;-x&quot;
+              "Unable to convert oops to destination type
+- while parsing: (-x, --abortx &lt;no. failures>)" contains: "-x"
             </Expanded>
           </Expression>
           <OverallResults successes="1" failures="0" expectedFailures="0"/>
@@ -4225,10 +4338,10 @@
           </Expression>
           <Expression success="true" type="REQUIRE" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              config.outputFilename == &quot;filename.ext&quot;
+              config.outputFilename == "filename.ext"
             </Original>
             <Expanded>
-              &quot;filename.ext&quot; == &quot;filename.ext&quot;
+              "filename.ext" == "filename.ext"
             </Expanded>
           </Expression>
           <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4247,10 +4360,10 @@
           </Expression>
           <Expression success="true" type="REQUIRE" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              config.outputFilename == &quot;filename.ext&quot;
+              config.outputFilename == "filename.ext"
             </Original>
             <Expanded>
-              &quot;filename.ext&quot; == &quot;filename.ext&quot;
+              "filename.ext" == "filename.ext"
             </Expanded>
           </Expression>
           <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4349,9 +4462,9 @@
               Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString
             </Original>
             <Expanded>
-              &quot;one two three four&quot;
+              "one two three four"
 ==
-&quot;one two three four&quot;
+"one two three four"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
@@ -4359,9 +4472,9 @@
               Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString
             </Original>
             <Expanded>
-              &quot;one two three four&quot;
+              "one two three four"
 ==
-&quot;one two three four&quot;
+"one two three four"
             </Expanded>
           </Expression>
           <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4372,62 +4485,62 @@
         <Section name="Wrapped once">
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 17 ) ).toString() == &quot;one two three\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 17 ) ).toString() == "one two three\nfour"
             </Original>
             <Expanded>
-              &quot;one two three
-four&quot;
+              "one two three
+four"
 ==
-&quot;one two three
-four&quot;
+"one two three
+four"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 16 ) ).toString() == &quot;one two three\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 16 ) ).toString() == "one two three\nfour"
             </Original>
             <Expanded>
-              &quot;one two three
-four&quot;
+              "one two three
+four"
 ==
-&quot;one two three
-four&quot;
+"one two three
+four"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 14 ) ).toString() == &quot;one two three\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 14 ) ).toString() == "one two three\nfour"
             </Original>
             <Expanded>
-              &quot;one two three
-four&quot;
+              "one two three
+four"
 ==
-&quot;one two three
-four&quot;
+"one two three
+four"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 13 ) ).toString() == &quot;one two three\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 13 ) ).toString() == "one two three\nfour"
             </Original>
             <Expanded>
-              &quot;one two three
-four&quot;
+              "one two three
+four"
 ==
-&quot;one two three
-four&quot;
+"one two three
+four"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 12 ) ).toString() == &quot;one two\nthree four&quot;
+              Text( testString, TextAttributes().setWidth( 12 ) ).toString() == "one two\nthree four"
             </Original>
             <Expanded>
-              &quot;one two
-three four&quot;
+              "one two
+three four"
 ==
-&quot;one two
-three four&quot;
+"one two
+three four"
             </Expanded>
           </Expression>
           <OverallResults successes="5" failures="0" expectedFailures="0"/>
@@ -4438,44 +4551,44 @@
         <Section name="Wrapped twice">
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 9 ) ).toString() == &quot;one two\nthree\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour"
             </Original>
             <Expanded>
-              &quot;one two
+              "one two
 three
-four&quot;
+four"
 ==
-&quot;one two
+"one two
 three
-four&quot;
+four"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 8 ) ).toString() == &quot;one two\nthree\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour"
             </Original>
             <Expanded>
-              &quot;one two
+              "one two
 three
-four&quot;
+four"
 ==
-&quot;one two
+"one two
 three
-four&quot;
+four"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 7 ) ).toString() == &quot;one two\nthree\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour"
             </Original>
             <Expanded>
-              &quot;one two
+              "one two
 three
-four&quot;
+four"
 ==
-&quot;one two
+"one two
 three
-four&quot;
+four"
             </Expanded>
           </Expression>
           <OverallResults successes="3" failures="0" expectedFailures="0"/>
@@ -4486,34 +4599,34 @@
         <Section name="Wrapped three times">
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 6 ) ).toString() == &quot;one\ntwo\nthree\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour"
             </Original>
             <Expanded>
-              &quot;one
+              "one
 two
 three
-four&quot;
+four"
 ==
-&quot;one
+"one
 two
 three
-four&quot;
+four"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 5 ) ).toString() == &quot;one\ntwo\nthree\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 5 ) ).toString() == "one\ntwo\nthree\nfour"
             </Original>
             <Expanded>
-              &quot;one
+              "one
 two
 three
-four&quot;
+four"
 ==
-&quot;one
+"one
 two
 three
-four&quot;
+four"
             </Expanded>
           </Expression>
           <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4524,78 +4637,78 @@
         <Section name="Short wrap">
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( &quot;abcdef&quot;, TextAttributes().setWidth( 4 ) ).toString() == &quot;abc-\ndef&quot;
+              Text( "abcdef", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef"
             </Original>
             <Expanded>
-              &quot;abc-
-def&quot;
+              "abc-
+def"
 ==
-&quot;abc-
-def&quot;
+"abc-
+def"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( &quot;abcdefg&quot;, TextAttributes().setWidth( 4 ) ).toString() == &quot;abc-\ndefg&quot;
+              Text( "abcdefg", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndefg"
             </Original>
             <Expanded>
-              &quot;abc-
-defg&quot;
+              "abc-
+defg"
 ==
-&quot;abc-
-defg&quot;
+"abc-
+defg"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( &quot;abcdefgh&quot;, TextAttributes().setWidth( 4 ) ).toString() == &quot;abc-\ndef-\ngh&quot;
+              Text( "abcdefgh", TextAttributes().setWidth( 4 ) ).toString() == "abc-\ndef-\ngh"
             </Original>
             <Expanded>
-              &quot;abc-
+              "abc-
 def-
-gh&quot;
+gh"
 ==
-&quot;abc-
+"abc-
 def-
-gh&quot;
+gh"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 4 ) ).toString() == &quot;one\ntwo\nthr-\nee\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 4 ) ).toString() == "one\ntwo\nthr-\nee\nfour"
             </Original>
             <Expanded>
-              &quot;one
+              "one
 two
 thr-
 ee
-four&quot;
+four"
 ==
-&quot;one
+"one
 two
 thr-
 ee
-four&quot;
+four"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 3 ) ).toString() == &quot;one\ntwo\nth-\nree\nfo-\nur&quot;
+              Text( testString, TextAttributes().setWidth( 3 ) ).toString() == "one\ntwo\nth-\nree\nfo-\nur"
             </Original>
             <Expanded>
-              &quot;one
+              "one
 two
 th-
 ree
 fo-
-ur&quot;
+ur"
 ==
-&quot;one
+"one
 two
 th-
 ree
 fo-
-ur&quot;
+ur"
             </Expanded>
           </Expression>
           <OverallResults successes="5" failures="0" expectedFailures="0"/>
@@ -4614,34 +4727,34 @@
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              text[0] == &quot;one&quot;
+              text[0] == "one"
             </Original>
             <Expanded>
-              &quot;one&quot; == &quot;one&quot;
+              "one" == "one"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              text[1] == &quot;two&quot;
+              text[1] == "two"
             </Original>
             <Expanded>
-              &quot;two&quot; == &quot;two&quot;
+              "two" == "two"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              text[2] == &quot;three&quot;
+              text[2] == "three"
             </Original>
             <Expanded>
-              &quot;three&quot; == &quot;three&quot;
+              "three" == "three"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              text[3] == &quot;four&quot;
+              text[3] == "four"
             </Original>
             <Expanded>
-              &quot;four&quot; == &quot;four&quot;
+              "four" == "four"
             </Expanded>
           </Expression>
           <OverallResults successes="5" failures="0" expectedFailures="0"/>
@@ -4652,16 +4765,16 @@
         <Section name="Indent first line differently">
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              text.toString() == &quot; one two\n    three\n    four&quot;
+              text.toString() == " one two\n    three\n    four"
             </Original>
             <Expanded>
-              &quot; one two
+              " one two
     three
-    four&quot;
+    four"
 ==
-&quot; one two
+" one two
     three
-    four&quot;
+    four"
             </Expanded>
           </Expression>
           <OverallResults successes="1" failures="0" expectedFailures="0"/>
@@ -4675,11 +4788,11 @@
               Text( testString, TextAttributes().setWidth( 80 ) ).toString() == testString
             </Original>
             <Expanded>
-              &quot;one two
-three four&quot;
+              "one two
+three four"
 ==
-&quot;one two
-three four&quot;
+"one two
+three four"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
@@ -4687,11 +4800,11 @@
               Text( testString, TextAttributes().setWidth( 18 ) ).toString() == testString
             </Original>
             <Expanded>
-              &quot;one two
-three four&quot;
+              "one two
+three four"
 ==
-&quot;one two
-three four&quot;
+"one two
+three four"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
@@ -4699,11 +4812,11 @@
               Text( testString, TextAttributes().setWidth( 10 ) ).toString() == testString
             </Original>
             <Expanded>
-              &quot;one two
-three four&quot;
+              "one two
+three four"
 ==
-&quot;one two
-three four&quot;
+"one two
+three four"
             </Expanded>
           </Expression>
           <OverallResults successes="3" failures="0" expectedFailures="0"/>
@@ -4714,34 +4827,34 @@
         <Section name="Trailing newline">
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( &quot;abcdef\n&quot;, TextAttributes().setWidth( 10 ) ).toString() == &quot;abcdef\n&quot;
+              Text( "abcdef\n", TextAttributes().setWidth( 10 ) ).toString() == "abcdef\n"
             </Original>
             <Expanded>
-              &quot;abcdef
-&quot;
+              "abcdef
+"
 ==
-&quot;abcdef
-&quot;
+"abcdef
+"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( &quot;abcdef&quot;, TextAttributes().setWidth( 6 ) ).toString() == &quot;abcdef&quot;
+              Text( "abcdef", TextAttributes().setWidth( 6 ) ).toString() == "abcdef"
             </Original>
             <Expanded>
-              &quot;abcdef&quot; == &quot;abcdef&quot;
+              "abcdef" == "abcdef"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( &quot;abcdef\n&quot;, TextAttributes().setWidth( 6 ) ).toString() == &quot;abcdef\n&quot;
+              Text( "abcdef\n", TextAttributes().setWidth( 6 ) ).toString() == "abcdef\n"
             </Original>
             <Expanded>
-              &quot;abcdef
-&quot;
+              "abcdef
+"
 ==
-&quot;abcdef
-&quot;
+"abcdef
+"
             </Expanded>
           </Expression>
           <OverallResults successes="3" failures="0" expectedFailures="0"/>
@@ -4752,44 +4865,44 @@
         <Section name="Wrapped once">
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 9 ) ).toString() == &quot;one two\nthree\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 9 ) ).toString() == "one two\nthree\nfour"
             </Original>
             <Expanded>
-              &quot;one two
+              "one two
 three
-four&quot;
+four"
 ==
-&quot;one two
+"one two
 three
-four&quot;
+four"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 8 ) ).toString() == &quot;one two\nthree\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 8 ) ).toString() == "one two\nthree\nfour"
             </Original>
             <Expanded>
-              &quot;one two
+              "one two
 three
-four&quot;
+four"
 ==
-&quot;one two
+"one two
 three
-four&quot;
+four"
             </Expanded>
           </Expression>
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 7 ) ).toString() == &quot;one two\nthree\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 7 ) ).toString() == "one two\nthree\nfour"
             </Original>
             <Expanded>
-              &quot;one two
+              "one two
 three
-four&quot;
+four"
 ==
-&quot;one two
+"one two
 three
-four&quot;
+four"
             </Expanded>
           </Expression>
           <OverallResults successes="3" failures="0" expectedFailures="0"/>
@@ -4800,18 +4913,18 @@
         <Section name="Wrapped twice">
           <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
             <Original>
-              Text( testString, TextAttributes().setWidth( 6 ) ).toString() == &quot;one\ntwo\nthree\nfour&quot;
+              Text( testString, TextAttributes().setWidth( 6 ) ).toString() == "one\ntwo\nthree\nfour"
             </Original>
             <Expanded>
-              &quot;one
+              "one
 two
 three
-four&quot;
+four"
 ==
-&quot;one
+"one
 two
 three
-four&quot;
+four"
             </Expanded>
           </Expression>
           <OverallResults successes="1" failures="0" expectedFailures="0"/>
@@ -4821,18 +4934,18 @@
       <Section name="With tabs">
         <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            Text( testString, TextAttributes().setWidth( 15 ) ).toString() == &quot;one two three\n        four\n        five\n        six&quot;
+            Text( testString, TextAttributes().setWidth( 15 ) ).toString() == "one two three\n        four\n        five\n        six"
           </Original>
           <Expanded>
-            &quot;one two three
+            "one two three
         four
         five
-        six&quot;
+        six"
 ==
-&quot;one two three
+"one two three
         four
         five
-        six&quot;
+        six"
           </Expanded>
         </Expression>
         <OverallResults successes="1" failures="0" expectedFailures="0"/>
@@ -4843,7 +4956,7 @@
       <Section name="replace single char">
         <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            replaceInPlace( letters, &quot;b&quot;, &quot;z&quot; )
+            replaceInPlace( letters, "b", "z" )
           </Original>
           <Expanded>
             true
@@ -4851,10 +4964,10 @@
         </Expression>
         <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            letters == &quot;azcdefcg&quot;
+            letters == "azcdefcg"
           </Original>
           <Expanded>
-            &quot;azcdefcg&quot; == &quot;azcdefcg&quot;
+            "azcdefcg" == "azcdefcg"
           </Expanded>
         </Expression>
         <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4862,7 +4975,7 @@
       <Section name="replace two chars">
         <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            replaceInPlace( letters, &quot;c&quot;, &quot;z&quot; )
+            replaceInPlace( letters, "c", "z" )
           </Original>
           <Expanded>
             true
@@ -4870,10 +4983,10 @@
         </Expression>
         <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            letters == &quot;abzdefzg&quot;
+            letters == "abzdefzg"
           </Original>
           <Expanded>
-            &quot;abzdefzg&quot; == &quot;abzdefzg&quot;
+            "abzdefzg" == "abzdefzg"
           </Expanded>
         </Expression>
         <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4881,7 +4994,7 @@
       <Section name="replace first char">
         <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            replaceInPlace( letters, &quot;a&quot;, &quot;z&quot; )
+            replaceInPlace( letters, "a", "z" )
           </Original>
           <Expanded>
             true
@@ -4889,10 +5002,10 @@
         </Expression>
         <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            letters == &quot;zbcdefcg&quot;
+            letters == "zbcdefcg"
           </Original>
           <Expanded>
-            &quot;zbcdefcg&quot; == &quot;zbcdefcg&quot;
+            "zbcdefcg" == "zbcdefcg"
           </Expanded>
         </Expression>
         <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4900,7 +5013,7 @@
       <Section name="replace last char">
         <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            replaceInPlace( letters, &quot;g&quot;, &quot;z&quot; )
+            replaceInPlace( letters, "g", "z" )
           </Original>
           <Expanded>
             true
@@ -4908,10 +5021,10 @@
         </Expression>
         <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            letters == &quot;abcdefcz&quot;
+            letters == "abcdefcz"
           </Original>
           <Expanded>
-            &quot;abcdefcz&quot; == &quot;abcdefcz&quot;
+            "abcdefcz" == "abcdefcz"
           </Expanded>
         </Expression>
         <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4919,7 +5032,7 @@
       <Section name="replace all chars">
         <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            replaceInPlace( letters, letters, &quot;replaced&quot; )
+            replaceInPlace( letters, letters, "replaced" )
           </Original>
           <Expanded>
             true
@@ -4927,10 +5040,10 @@
         </Expression>
         <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            letters == &quot;replaced&quot;
+            letters == "replaced"
           </Original>
           <Expanded>
-            &quot;replaced&quot; == &quot;replaced&quot;
+            "replaced" == "replaced"
           </Expanded>
         </Expression>
         <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4938,7 +5051,7 @@
       <Section name="replace no chars">
         <Expression success="true" type="CHECK_FALSE" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            !replaceInPlace( letters, &quot;x&quot;, &quot;z&quot; )
+            !replaceInPlace( letters, "x", "z" )
           </Original>
           <Expanded>
             !false
@@ -4949,7 +5062,7 @@
             letters == letters
           </Original>
           <Expanded>
-            &quot;abcdefcg&quot; == &quot;abcdefcg&quot;
+            "abcdefcg" == "abcdefcg"
           </Expanded>
         </Expression>
         <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4957,7 +5070,7 @@
       <Section name="escape '">
         <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            replaceInPlace( s, &quot;'&quot;, &quot;|'&quot; )
+            replaceInPlace( s, "'", "|'" )
           </Original>
           <Expanded>
             true
@@ -4965,10 +5078,10 @@
         </Expression>
         <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
           <Original>
-            s == &quot;didn|'t&quot;
+            s == "didn|'t"
           </Original>
           <Expanded>
-            &quot;didn|'t&quot; == &quot;didn|'t&quot;
+            "didn|'t" == "didn|'t"
           </Expanded>
         </Expression>
         <OverallResults successes="2" failures="0" expectedFailures="0"/>
@@ -4981,22 +5094,22 @@
     <TestCase name="Text can be formatted using the Text class">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
         <Original>
-          Text( &quot;hi there&quot; ).toString() == &quot;hi there&quot;
+          Text( "hi there" ).toString() == "hi there"
         </Original>
         <Expanded>
-          &quot;hi there&quot; == &quot;hi there&quot;
+          "hi there" == "hi there"
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK" filename="projects/SelfTest/TestMain.cpp" >
         <Original>
-          Text( &quot;hi there&quot;, narrow ).toString() == &quot;hi\nthere&quot;
+          Text( "hi there", narrow ).toString() == "hi\nthere"
         </Original>
         <Expanded>
-          &quot;hi
-there&quot;
+          "hi
+there"
 ==
-&quot;hi
-there&quot;
+"hi
+there"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -5004,10 +5117,10 @@
     <TestCase name="Long text is truncted">
       <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/TestMain.cpp" >
         <Original>
-          t.toString() EndsWith( &quot;... message truncated due to excessive size&quot; )
+          t.toString() EndsWith( "... message truncated due to excessive size" )
         </Original>
         <Expanded>
-          &quot;******************************************************************************-
+          "******************************************************************************-
 ******************************************************************************-
 ************************
 ******************************************************************************-
@@ -6007,7 +6120,7 @@
 ******************************************************************************-
 ************************
 ******************************************************************************-
-... message truncated due to excessive size&quot; ends with: &quot;... message truncated due to excessive size&quot;
+... message truncated due to excessive size" ends with: "... message truncated due to excessive size"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6057,10 +6170,10 @@
     <TestCase name="string literals of different sizes can be compared">
       <Expression success="false" type="REQUIRE" filename="projects/SelfTest/TrickyTests.cpp" >
         <Original>
-          std::string( &quot;first&quot; ) == &quot;second&quot;
+          std::string( "first" ) == "second"
         </Original>
         <Expanded>
-          &quot;first&quot; == &quot;second&quot;
+          "first" == "second"
         </Expanded>
       </Expression>
       <OverallResult success="false"/>
@@ -6303,10 +6416,10 @@
     <TestCase name="non streamable - with conv. op">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/TrickyTests.cpp" >
         <Original>
-          s == &quot;7&quot;
+          s == "7"
         </Original>
         <Expanded>
-          &quot;7&quot; == &quot;7&quot;
+          "7" == "7"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6380,12 +6493,12 @@
     <TestCase name="toString( has_toString )">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringWhich.cpp" >
         <Original>
-          Catch::toString( item ) == &quot;toString( has_toString )&quot;
+          Catch::toString( item ) == "toString( has_toString )"
         </Original>
         <Expanded>
-          &quot;toString( has_toString )&quot;
+          "toString( has_toString )"
 ==
-&quot;toString( has_toString )&quot;
+"toString( has_toString )"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6393,12 +6506,12 @@
     <TestCase name="toString( has_maker )">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringWhich.cpp" >
         <Original>
-          Catch::toString( item ) == &quot;StringMaker&lt;has_maker>&quot;
+          Catch::toString( item ) == "StringMaker&lt;has_maker>"
         </Original>
         <Expanded>
-          &quot;StringMaker&lt;has_maker>&quot;
+          "StringMaker&lt;has_maker>"
 ==
-&quot;StringMaker&lt;has_maker>&quot;
+"StringMaker&lt;has_maker>"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6406,12 +6519,12 @@
     <TestCase name="toString( has_maker_and_toString )">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringWhich.cpp" >
         <Original>
-          Catch::toString( item ) == &quot;toString( has_maker_and_toString )&quot;
+          Catch::toString( item ) == "toString( has_maker_and_toString )"
         </Original>
         <Expanded>
-          &quot;toString( has_maker_and_toString )&quot;
+          "toString( has_maker_and_toString )"
 ==
-&quot;toString( has_maker_and_toString )&quot;
+"toString( has_maker_and_toString )"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6419,10 +6532,10 @@
     <TestCase name="toString( vectors&lt;has_toString )">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringWhich.cpp" >
         <Original>
-          Catch::toString( v ) == &quot;{ {?} }&quot;
+          Catch::toString( v ) == "{ {?} }"
         </Original>
         <Expanded>
-          &quot;{ {?} }&quot; == &quot;{ {?} }&quot;
+          "{ {?} }" == "{ {?} }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6430,12 +6543,12 @@
     <TestCase name="toString( vectors&lt;has_maker )">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringWhich.cpp" >
         <Original>
-          Catch::toString( v ) == &quot;{ StringMaker&lt;has_maker> }&quot;
+          Catch::toString( v ) == "{ StringMaker&lt;has_maker> }"
         </Original>
         <Expanded>
-          &quot;{ StringMaker&lt;has_maker> }&quot;
+          "{ StringMaker&lt;has_maker> }"
 ==
-&quot;{ StringMaker&lt;has_maker> }&quot;
+"{ StringMaker&lt;has_maker> }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6443,12 +6556,12 @@
     <TestCase name="toString( vectors&lt;has_maker_and_toString )">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringWhich.cpp" >
         <Original>
-          Catch::toString( v ) == &quot;{ StringMaker&lt;has_maker_and_toString> }&quot;
+          Catch::toString( v ) == "{ StringMaker&lt;has_maker_and_toString> }"
         </Original>
         <Expanded>
-          &quot;{ StringMaker&lt;has_maker_and_toString> }&quot;
+          "{ StringMaker&lt;has_maker_and_toString> }"
 ==
-&quot;{ StringMaker&lt;has_maker_and_toString> }&quot;
+"{ StringMaker&lt;has_maker_and_toString> }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6456,10 +6569,10 @@
     <TestCase name="std::pair&lt;int,std::string> -> toString">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringPair.cpp" >
         <Original>
-          Catch::toString( value ) == &quot;{ 34, \&quot;xyzzy\&quot; }&quot;
+          Catch::toString( value ) == "{ 34, \"xyzzy\" }"
         </Original>
         <Expanded>
-          &quot;{ 34, &quot;xyzzy&quot; }&quot; == &quot;{ 34, &quot;xyzzy&quot; }&quot;
+          "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6467,10 +6580,10 @@
     <TestCase name="std::pair&lt;int,const std::string> -> toString">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringPair.cpp" >
         <Original>
-          Catch::toString(value) == &quot;{ 34, \&quot;xyzzy\&quot; }&quot;
+          Catch::toString(value) == "{ 34, \"xyzzy\" }"
         </Original>
         <Expanded>
-          &quot;{ 34, &quot;xyzzy&quot; }&quot; == &quot;{ 34, &quot;xyzzy&quot; }&quot;
+          "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6478,12 +6591,12 @@
     <TestCase name="std::vector&lt;std::pair&lt;std::string,int> > -> toString">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringPair.cpp" >
         <Original>
-          Catch::toString( pr ) == &quot;{ { \&quot;green\&quot;, 55 } }&quot;
+          Catch::toString( pr ) == "{ { \"green\", 55 } }"
         </Original>
         <Expanded>
-          &quot;{ { &quot;green&quot;, 55 } }&quot;
+          "{ { "green", 55 } }"
 ==
-&quot;{ { &quot;green&quot;, 55 } }&quot;
+"{ { "green", 55 } }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6491,12 +6604,12 @@
     <TestCase name="pair&lt;pair&lt;int,const char *,pair&lt;std::string,int> > -> toString">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringPair.cpp" >
         <Original>
-          Catch::toString( pair ) == &quot;{ { 42, \&quot;Arthur\&quot; }, { \&quot;Ford\&quot;, 24 } }&quot;
+          Catch::toString( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }"
         </Original>
         <Expanded>
-          &quot;{ { 42, &quot;Arthur&quot; }, { &quot;Ford&quot;, 24 } }&quot;
+          "{ { 42, "Arthur" }, { "Ford", 24 } }"
 ==
-&quot;{ { 42, &quot;Arthur&quot; }, { &quot;Ford&quot;, 24 } }&quot;
+"{ { 42, "Arthur" }, { "Ford", 24 } }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6504,26 +6617,26 @@
     <TestCase name="vector&lt;int> -> toString">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringVector.cpp" >
         <Original>
-          Catch::toString(vv) == &quot;{  }&quot;
+          Catch::toString(vv) == "{  }"
         </Original>
         <Expanded>
-          &quot;{  }&quot; == &quot;{  }&quot;
+          "{  }" == "{  }"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringVector.cpp" >
         <Original>
-          Catch::toString(vv) == &quot;{ 42 }&quot;
+          Catch::toString(vv) == "{ 42 }"
         </Original>
         <Expanded>
-          &quot;{ 42 }&quot; == &quot;{ 42 }&quot;
+          "{ 42 }" == "{ 42 }"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringVector.cpp" >
         <Original>
-          Catch::toString(vv) == &quot;{ 42, 250 }&quot;
+          Catch::toString(vv) == "{ 42, 250 }"
         </Original>
         <Expanded>
-          &quot;{ 42, 250 }&quot; == &quot;{ 42, 250 }&quot;
+          "{ 42, 250 }" == "{ 42, 250 }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6531,28 +6644,28 @@
     <TestCase name="vector&lt;string> -> toString">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringVector.cpp" >
         <Original>
-          Catch::toString(vv) == &quot;{  }&quot;
+          Catch::toString(vv) == "{  }"
         </Original>
         <Expanded>
-          &quot;{  }&quot; == &quot;{  }&quot;
+          "{  }" == "{  }"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringVector.cpp" >
         <Original>
-          Catch::toString(vv) == &quot;{ \&quot;hello\&quot; }&quot;
+          Catch::toString(vv) == "{ \"hello\" }"
         </Original>
         <Expanded>
-          &quot;{ &quot;hello&quot; }&quot; == &quot;{ &quot;hello&quot; }&quot;
+          "{ "hello" }" == "{ "hello" }"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringVector.cpp" >
         <Original>
-          Catch::toString(vv) == &quot;{ \&quot;hello\&quot;, \&quot;world\&quot; }&quot;
+          Catch::toString(vv) == "{ \"hello\", \"world\" }"
         </Original>
         <Expanded>
-          &quot;{ &quot;hello&quot;, &quot;world&quot; }&quot;
+          "{ "hello", "world" }"
 ==
-&quot;{ &quot;hello&quot;, &quot;world&quot; }&quot;
+"{ "hello", "world" }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6560,26 +6673,26 @@
     <TestCase name="vector&lt;int,allocator> -> toString">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringVector.cpp" >
         <Original>
-          Catch::toString(vv) == &quot;{  }&quot;
+          Catch::toString(vv) == "{  }"
         </Original>
         <Expanded>
-          &quot;{  }&quot; == &quot;{  }&quot;
+          "{  }" == "{  }"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringVector.cpp" >
         <Original>
-          Catch::toString(vv) == &quot;{ 42 }&quot;
+          Catch::toString(vv) == "{ 42 }"
         </Original>
         <Expanded>
-          &quot;{ 42 }&quot; == &quot;{ 42 }&quot;
+          "{ 42 }" == "{ 42 }"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringVector.cpp" >
         <Original>
-          Catch::toString(vv) == &quot;{ 42, 250 }&quot;
+          Catch::toString(vv) == "{ 42, 250 }"
         </Original>
         <Expanded>
-          &quot;{ 42, 250 }&quot; == &quot;{ 42, 250 }&quot;
+          "{ 42, 250 }" == "{ 42, 250 }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6587,20 +6700,20 @@
     <TestCase name="vec&lt;vec&lt;string,alloc>> -> toString">
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringVector.cpp" >
         <Original>
-          Catch::toString(v) == &quot;{  }&quot;
+          Catch::toString(v) == "{  }"
         </Original>
         <Expanded>
-          &quot;{  }&quot; == &quot;{  }&quot;
+          "{  }" == "{  }"
         </Expanded>
       </Expression>
       <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ToStringVector.cpp" >
         <Original>
-          Catch::toString(v) == &quot;{ { \&quot;hello\&quot; }, { \&quot;world\&quot; } }&quot;
+          Catch::toString(v) == "{ { \"hello\" }, { \"world\" } }"
         </Original>
         <Expanded>
-          &quot;{ { &quot;hello&quot; }, { &quot;world&quot; } }&quot;
+          "{ { "hello" }, { "world" } }"
 ==
-&quot;{ { &quot;hello&quot; }, { &quot;world&quot; } }&quot;
+"{ { "hello" }, { "world" } }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -6819,7 +6932,7 @@
         </Expression>
         <Expression success="true" type="CHECK" filename="projects/SelfTest/CmdLineTests.cpp" >
           <Original>
-            parseTestSpec( &quot;*a&quot; ).matches( tcA ) == true
+            parseTestSpec( "*a" ).matches( tcA ) == true
           </Original>
           <Expanded>
             true == true
@@ -6870,7 +6983,7 @@
         </Expression>
         <Expression success="true" type="CHECK" filename="projects/SelfTest/CmdLineTests.cpp" >
           <Original>
-            parseTestSpec( &quot;a*&quot; ).matches( tcA ) == true
+            parseTestSpec( "a*" ).matches( tcA ) == true
           </Original>
           <Expanded>
             true == true
@@ -6921,7 +7034,7 @@
         </Expression>
         <Expression success="true" type="CHECK" filename="projects/SelfTest/CmdLineTests.cpp" >
           <Original>
-            parseTestSpec( &quot;*a*&quot; ).matches( tcA ) == true
+            parseTestSpec( "*a*" ).matches( tcA ) == true
           </Original>
           <Expanded>
             true == true
@@ -7784,18 +7897,18 @@
     <TestCase name="tuple&lt;>">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
         <Original>
-          &quot;{ }&quot; == Catch::toString(type{})
+          "{ }" == Catch::toString(type{})
         </Original>
         <Expanded>
-          &quot;{ }&quot; == &quot;{ }&quot;
+          "{ }" == "{ }"
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
         <Original>
-          &quot;{ }&quot; == Catch::toString(value)
+          "{ }" == Catch::toString(value)
         </Original>
         <Expanded>
-          &quot;{ }&quot; == &quot;{ }&quot;
+          "{ }" == "{ }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -7803,10 +7916,10 @@
     <TestCase name="tuple&lt;int>">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
         <Original>
-          &quot;{ 0 }&quot; == Catch::toString(type{0})
+          "{ 0 }" == Catch::toString(type{0})
         </Original>
         <Expanded>
-          &quot;{ 0 }&quot; == &quot;{ 0 }&quot;
+          "{ 0 }" == "{ 0 }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -7814,18 +7927,18 @@
     <TestCase name="tuple&lt;float,int>">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
         <Original>
-          &quot;1.2f&quot; == Catch::toString(float(1.2))
+          "1.2f" == Catch::toString(float(1.2))
         </Original>
         <Expanded>
-          &quot;1.2f&quot; == &quot;1.2f&quot;
+          "1.2f" == "1.2f"
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
         <Original>
-          &quot;{ 1.2f, 0 }&quot; == Catch::toString(type{1.2,0})
+          "{ 1.2f, 0 }" == Catch::toString(type{1.2,0})
         </Original>
         <Expanded>
-          &quot;{ 1.2f, 0 }&quot; == &quot;{ 1.2f, 0 }&quot;
+          "{ 1.2f, 0 }" == "{ 1.2f, 0 }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -7833,12 +7946,12 @@
     <TestCase name="tuple&lt;string,string>">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
         <Original>
-          &quot;{ \&quot;hello\&quot;, \&quot;world\&quot; }&quot; == Catch::toString(type{&quot;hello&quot;,&quot;world&quot;})
+          "{ \"hello\", \"world\" }" == Catch::toString(type{"hello","world"})
         </Original>
         <Expanded>
-          &quot;{ &quot;hello&quot;, &quot;world&quot; }&quot;
+          "{ "hello", "world" }"
 ==
-&quot;{ &quot;hello&quot;, &quot;world&quot; }&quot;
+"{ "hello", "world" }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -7846,12 +7959,12 @@
     <TestCase name="tuple&lt;tuple&lt;int>,tuple&lt;>,float>">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
         <Original>
-          &quot;{ { 42 }, { }, 1.2f }&quot; == Catch::toString(value)
+          "{ { 42 }, { }, 1.2f }" == Catch::toString(value)
         </Original>
         <Expanded>
-          &quot;{ { 42 }, { }, 1.2f }&quot;
+          "{ { 42 }, { }, 1.2f }"
 ==
-&quot;{ { 42 }, { }, 1.2f }&quot;
+"{ { 42 }, { }, 1.2f }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -7859,12 +7972,12 @@
     <TestCase name="tuple&lt;nullptr,int,const char *>">
       <Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
         <Original>
-          &quot;{ nullptr, 42, \&quot;Catch me\&quot; }&quot; == Catch::toString(value)
+          "{ nullptr, 42, \"Catch me\" }" == Catch::toString(value)
         </Original>
         <Expanded>
-          &quot;{ nullptr, 42, &quot;Catch me&quot; }&quot;
+          "{ nullptr, 42, "Catch me" }"
 ==
-&quot;{ nullptr, 42, &quot;Catch me&quot; }&quot;
+"{ nullptr, 42, "Catch me" }"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -7873,42 +7986,42 @@
       <Section name="The same tag alias can only be registered once">
         <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/TagAliasTests.cpp" >
           <Original>
-            what Contains( &quot;[@zzz]&quot; )
+            what Contains( "[@zzz]" )
           </Original>
           <Expanded>
-            &quot;error: tag alias, &quot;[@zzz]&quot; already registered.
+            "error: tag alias, "[@zzz]" already registered.
 	First seen at file:2
-	Redefined at file:10&quot; contains: &quot;[@zzz]&quot;
+	Redefined at file:10" contains: "[@zzz]"
           </Expanded>
         </Expression>
         <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/TagAliasTests.cpp" >
           <Original>
-            what Contains( &quot;file&quot; )
+            what Contains( "file" )
           </Original>
           <Expanded>
-            &quot;error: tag alias, &quot;[@zzz]&quot; already registered.
+            "error: tag alias, "[@zzz]" already registered.
 	First seen at file:2
-	Redefined at file:10&quot; contains: &quot;file&quot;
+	Redefined at file:10" contains: "file"
           </Expanded>
         </Expression>
         <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/TagAliasTests.cpp" >
           <Original>
-            what Contains( &quot;2&quot; )
+            what Contains( "2" )
           </Original>
           <Expanded>
-            &quot;error: tag alias, &quot;[@zzz]&quot; already registered.
+            "error: tag alias, "[@zzz]" already registered.
 	First seen at file:2
-	Redefined at file:10&quot; contains: &quot;2&quot;
+	Redefined at file:10" contains: "2"
           </Expanded>
         </Expression>
         <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/TagAliasTests.cpp" >
           <Original>
-            what Contains( &quot;10&quot; )
+            what Contains( "10" )
           </Original>
           <Expanded>
-            &quot;error: tag alias, &quot;[@zzz]&quot; already registered.
+            "error: tag alias, "[@zzz]" already registered.
 	First seen at file:2
-	Redefined at file:10&quot; contains: &quot;10&quot;
+	Redefined at file:10" contains: "10"
           </Expanded>
         </Expression>
         <OverallResults successes="4" failures="0" expectedFailures="0"/>
@@ -7916,34 +8029,34 @@
       <Section name="Tag aliases must be of the form [@name]">
         <Expression success="true" type="CHECK_THROWS" filename="projects/SelfTest/TagAliasTests.cpp" >
           <Original>
-            registry.add( &quot;[no ampersat]&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
+            registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) )
           </Original>
           <Expanded>
-            registry.add( &quot;[no ampersat]&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
+            registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) )
           </Expanded>
         </Expression>
         <Expression success="true" type="CHECK_THROWS" filename="projects/SelfTest/TagAliasTests.cpp" >
           <Original>
-            registry.add( &quot;[the @ is not at the start]&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
+            registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) )
           </Original>
           <Expanded>
-            registry.add( &quot;[the @ is not at the start]&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
+            registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) )
           </Expanded>
         </Expression>
         <Expression success="true" type="CHECK_THROWS" filename="projects/SelfTest/TagAliasTests.cpp" >
           <Original>
-            registry.add( &quot;@no square bracket at start]&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
+            registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) )
           </Original>
           <Expanded>
-            registry.add( &quot;@no square bracket at start]&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
+            registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) )
           </Expanded>
         </Expression>
         <Expression success="true" type="CHECK_THROWS" filename="projects/SelfTest/TagAliasTests.cpp" >
           <Original>
-            registry.add( &quot;[@no square bracket at end&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
+            registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) )
           </Original>
           <Expanded>
-            registry.add( &quot;[@no square bracket at end&quot;, &quot;&quot;, Catch::SourceLineInfo( &quot;file&quot;, 3 ) )
+            registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) )
           </Expanded>
         </Expression>
         <OverallResults successes="4" failures="0" expectedFailures="0"/>
@@ -8299,7 +8412,7 @@
       </Section>
       <OverallResult success="true"/>
     </TestCase>
-    <OverallResults successes="680" failures="100" expectedFailures="13"/>
+    <OverallResults successes="690" failures="100" expectedFailures="13"/>
   </Group>
-  <OverallResults successes="680" failures="100" expectedFailures="13"/>
+  <OverallResults successes="690" failures="100" expectedFailures="13"/>
 </Catch>
diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp
index d91db94..04b86c8 100644
--- a/projects/SelfTest/MiscTests.cpp
+++ b/projects/SelfTest/MiscTests.cpp
@@ -7,6 +7,7 @@
  */
 
 #include "catch.hpp"
+#include "catch_xmlwriter.hpp"
 
 #include <iostream>
 
@@ -381,6 +382,42 @@
 	CHECK( result == "\"wide load\"" );
 }
 
+inline std::string encode( std::string const& str, Catch::XmlEncode::ForWhat forWhat = Catch::XmlEncode::ForTextNodes ) {
+    std::ostringstream oss;
+    oss << Catch::XmlEncode( str, forWhat );
+    return oss.str();
+}
+
+TEST_CASE( "XmlEncode" ) {
+    SECTION( "normal string" ) {
+        REQUIRE( encode( "normal string" ) == "normal string" );
+    }
+    SECTION( "empty string" ) {
+        REQUIRE( encode( "" ) == "" );
+    }
+    SECTION( "string with ampersand" ) {
+        REQUIRE( encode( "smith & jones" ) == "smith &amp; jones" );
+    }
+    SECTION( "string with less-than" ) {
+        REQUIRE( encode( "smith < jones" ) == "smith &lt; jones" );
+    }
+    SECTION( "string with greater-than" ) {
+        REQUIRE( encode( "smith > jones" ) == "smith > jones" );
+        REQUIRE( encode( "smith ]]> jones" ) == "smith ]]&gt; jones" );
+    }
+    SECTION( "string with quotes" ) {
+        std::string stringWithQuotes = "don't \"quote\" me on that";
+        REQUIRE( encode( stringWithQuotes ) == stringWithQuotes );
+        REQUIRE( encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't &quot;quote&quot; me on that" );
+    }
+    SECTION( "string with control char (1)" ) {
+        REQUIRE( encode( "[\x01]" ) == "[&#x1]" );
+    }
+    SECTION( "string with control char (x7F)" ) {
+        REQUIRE( encode( "[\x7F]" ) == "[&#x7F]" );
+    }
+}
+
 //TEST_CASE( "Divide by Zero signal handler", "[.][sig]" ) {
 //    int i = 0;
 //    int x = 10/i; // This should cause the signal to fire