title: Using binary data in C++ string
body: <p>I am working with binary data coming from a service provider. I am subscribing to this data through HTTP request, using C++.
  Every now and then, I get an HTML payload coming from this provider. The HTML payload is actually binary data, which looks like that:</p>
  
  <p><code>! ¦ô¿ÂË¤ ÍÌL?  Àÿ  Àÿ¥ š™©@  Àÿ  Àÿ</code> or <code>! H·ô¿ÂË¤ ÍÌL?  Àÿ333?¥ š™©@  Àÿff¦@</code></p>
  
  <p>I would like to do simulation using the data I get. To do so I hard code the data in a string and launch my program that will use those strings.</p>
  
  <p><code>std::string input = "! ¦ô¿ÂË¤ ÍÌL?  Àÿ  Àÿ¥ š™©@  Àÿ  Àÿ"</code></p>
  
  <p>The first issue I have is that I have to escape all characters like <code>\n</code>. But I don't know how to escape <code>\0</code> for example. Also, I have this error message, which may be due to the fact that I don't escape the end of file character properly:</p>
  
  <p><code>Error  3   fatal error C1004: unexpected end-of-file found</code></p>
  
  <p>So the main question is: what does the end-of-file character looks like, and how can I escape it ?</p>
  
  <p>Then, is there a linux command or a way to take binary data from a binary file, and escape all the special character with <code>\</code> so then I just copy paste it in my C++ code.</p>
  
  <p>Eventually, I would like to put all the different payloads I have got, in a binary file, so I can launch my simulation using this file. The issue is that I don't know how to separate different payloads, since just going to the next line won't do the trick, because it will be interpreted as a random character (and the payload don't have a fix size). I don't know what kind of separator to use.</p>