Converting accented characters to std::string returns mangled text
If my QString's value is
the function QString::toStdString() will return
whereas the function QString::toStdU16String will return the actual string
Why is that ? Å is a UTF-8 character as can be seen here : http://www.fileformat.info/info/charset/UTF-8/list.htm.
Re: Converting accented characters to std::string returns mangled text
std:: string is a template specialization of std:: basic_string<T>, with T being "char". If you want conversion of non-ASCII characters, you need to use std:: wstring (which is the basic_string specialization that uses wchar_t). The QString conversion is QString::toStdWString().