I currently have a std::string and it contains this
"\xa9 2006 FooWorld" Basically it contains the symbol © . This string is being passed to a method to an external API that takes in UTF-8. How could I make this string UTF-8 compatible ? Any suggestions. I read here I could use std::wstring_convert but I am not sure how to apply it in my case. Any suggestions would be appreciated.
std::stringstores bytes, not characters. So if you do not know the original encoding, there's no way guaranteed to work. If you know the original encoding is utf8, then you do not need anything extra, because, again,std::stringstores the encoding bytes.