Search code examples
qtftplocaleurlencode

how to decode QUrlnfo.name()?


I received the following QUrlInfo string from QFtp::listInfo(QUrlInfo) and the correct URL fragment is actually set to ©®§µ here in a test.

But QUrlInfo.name() returns a String containing ©®§µ. I realize I must encode it somehow, but how do I do that?


Solution

  • This should work:

    QString::fromUtf8(info.name().toAscii());