how do i replace each occurrence of a specific ascii character in a std::string with a unicode character?
im trying (using em dash as an example)
string mystring;
replace(mystring.begin(), mystring.end(), ' ', '—'); // error: 2nd char is too wide for char
replace(mystring.begin(), mystring.end(), " ", "—"); // error: replace() does not exist
i could of course write a loop, but i was hoping for there to be a single standard function available for this. im aware that the modified string will be longer that the original string.
seems like a silly basic problem, but 1 hour of googling solved zilch.