Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved QT5 : no member named 'setCodecForTr' in QTextCodec

    Mobile and Embedded
    2
    2
    2266
    Loading More Posts
    • 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.
    • H
      hakanaktan last edited by

      Hi,

      i copied my code from Qt 4.8.3 to Qt 5. i get error messagess on build.

      QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
          QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
      

      Error messagess:
      no member named 'setCodecForTr' in QTextCodec.
      no member named 'setCodecForCString' in QTextCodec.

      When i look inside QTextCodec.h file , i can not seet these (setCodecForTr and setCodecForCString) methods.

      How will i continue supporting multilanguage?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Indeed it's explained here.

        As for your issue, the best thing to do is to save your sources directly in UTF-8.

        You can see why here.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 2
        • First post
          Last post