The following string has size 4 not 3 as I would have expected.
std::string s = "\r\n½";
int ss = s.size(); //ss is 4
When loop through the string character by character escaping it to hex I get
- 0x0D (hex code for carriage return)
- 0x0A (hex code for line feed)
- 0xc2 (hex code, but what is this?)
- 0xbd (hex code for the ½ character)
Where does the 0xc2 come from? Is it some sort of encoding information? I though std::string had a char per visible character in the string. Can someone confirm 0xc2 is a "character set modifier"?