title: std::string's character reference
body: <p>I have the following string:</p>
  
  <pre><code>index                                       0   1   2   3   4   5   6   7
  std::string myString with the content of "\xff\xff\xff\x00\xff\x0d\x0a\xf5"
  </code></pre>
  
  <p>When I'm refering to myString[3], I get the expected '\x00' value.</p>
  
  <p>But when I'm referring to myString[5], I get two values "\x0d\x0a" instead of just '\x0d'. </p>
  
  <p>Even more interesting is the myString[6] value, which is the '\xf5'. This time it's like the \x0d didn't exist and the correct position was referenced.</p>
  
  <p>My question would be: what is so special about the \x0d character in a std:string object? How come it is skipped when indexing? It's like counting this way:</p>
  
  <pre><code>index                     0   1   2   3   4   5   5   6
  std::string myString = "\xff\xff\xff\x00\xff\x0d\x0a\xf5"
  </code></pre>
  
  <p>As a comment, the '\x0d' character is the 13th ASCII character "carriage return" and '\x0a' is the line feed character.</p>
  
  <p>UPDATE: Can it be that std::string considers "\x0d\x0a" as a single character and thus occupies only one position in the string? Is this '\x0d' a "mystery" character with regard to std::string?</p>
  
  <p>ADDITIONAL INFO: <a href="http://en.wikipedia.org/wiki/Newline" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Newline</a></p>