Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] qDebug() << "ąę" vs qDebug() << QString::fromUtf8("ąę");

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

Scheduled Pinned Locked Moved General and Desktop
qt5.5qdebugqstringencoding
2 Posts 2 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mkolenda
    wrote on last edited by mkolenda
    #1

    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.

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2
      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.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved