Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QT5 : no member named 'setCodecForTr' in QTextCodec
Forum Updated to NodeBB v4.3 + New Features

QT5 : no member named 'setCodecForTr' in QTextCodec

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 2 Posters 3.7k Views 2 Watching
  • 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 Offline
    H Offline
    hakanaktan
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      2

      • Login

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