Regarding String encoding



  • Hi,

    I am working on one migration project from Qt4 to Qt5 where in Qt4 i am getting the string correctly however in Qt5 i can see some encoded character like "\u0006", "\u0000x\u0084\u009DB" in the returened string. Could you please tell me how to remove or suppress those characters?



  • @sonulohani Can you give a minimal self-contained example project where it happens?


  • Lifetime Qt Champion

    Hi,

    What are you using that shows these characters ?


  • Moderators

    @sonulohani said in Regarding String encoding:

    "\u0006", "\u0000x\u0084\u009"

    These are non-printable characters that your code has entered into your string. Qt 4's qDebug() does not show them, but they are still there. Are you sure you want these in your string?

    Anyway, if you want to hide the non-printable characters in Qt 5, you can replace "qDebug()" with "qDebug().noquote()". See https://bugreports.qt.io/browse/QTBUG-47316



  • In addition to previous posts, you are getting these chats on screen. Do u see a issue with string when manipulate or compare etc ? Can you give code snippet to show string is actually not the intended one ? Again don't get misled by debug print.


Log in to reply