[SOLVED] qDebug() << "ąę" vs qDebug() << QString::fromUtf8("ąę");



  • Qt version: 5.5

    qDebug() << "ąę" prints ąę.
    QString::fromUtf8("ąę") prints "\uxxxx\uxxxx"

    How am I supposed to persuade

    QString fileName = QString::fromUtf8("ąę_forchristsake.łęż.zip");
    qDebug() << QString("I have properly opened file %1").arg(fileName);
    

    to properly print:

    "I have properly opened file ąę_forchristsake.łęż.zip"
    

    Excuse me for grotesque.


  • Moderators

    qDebug().noquote() << QString("I have properly opened file %1").arg(fileName);
    

    But please... don't use non-ascii characters in source code. That's just being mean to others.