Escaped represention of std::string
<p>I'm executing the following code, have read this:</p>

<p><a href="http://stackoverflow.com/questions/2417588/escaping-a-c-string">Escaping a C++ string</a></p>

<pre><code>#include &lt;iostream&gt;
#include &lt;boost/format.hpp&gt;
#include &lt;boost/algorithm/string.hpp&gt;

struct CharacterEscaper
{
    template&lt;typename FindResultT&gt;
    std::string operator()(const FindResultT&amp; Match) const
    {
        std::string s;
        for (typename FindResultT::const_iterator i = Match.begin();i != Match.end();i++) 
        {
            s += str(boost::format("\\x%02x") % static_cast&lt;int&gt;(*i));
        }
        return s;
    }
};

int main (int argc, char **argv)
{
    std::string s("start\x0aend");
    boost::find_format_all(s, boost::token_finder(!boost::is_print()), CharacterEscaper());
    std::cout &lt;&lt; s &lt;&lt; std::endl;
    return 0;
}
</code></pre>

<p>The output I'm getting is this: </p>

<pre><code>start\xffffffaend
</code></pre>

<p>I was expecting the following:</p>

<pre><code>start\x0aend
</code></pre>

<p>having read this:</p>

<p><a href="http://en.cppreference.com/w/cpp/language/escape" rel="nofollow">http://en.cppreference.com/w/cpp/language/escape</a></p>

<p>What is correct?</p>
