Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions

QSqlField to UTF-8



  • Hi, I'm doing queries that return strings with characters like Ñ, é, á, etc; but instead of that characters, I got another symbols that looks like trash at my interface.

    With Qt4.8 I fixed with this lines:

    @QTextCodec::setCodecForTr(QTextCodec::codecForName("ISO-8859-1"));
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("ISO-8859-1"));
    @

    But with Qt 5, setCodecForCStrings it's deprecated. So, what can I do?

    Thanks


Log in to reply