I need convert a QString to an std::string. However, if this string contains unicode symbols, I get ????. How can I convert the string with the proper encoding?
Thank you.
How did you try to convert the string so far?
According to documentation std::string QString::toStdString () should convert the unicode-data to an ascii-string
But be warned that you loose special-chars which ascii can't handle.
According to Qt documentation, QString::toStdString internally uses toAscii() function: http://doc.qt.nokia.com/latest/qstring.html#toStdString
Basically, you'll need to make your own converter function that would use QString::toUtf8() instead.