Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    Unsolved "codecForName " use this function i can't get anything for GB2312

    Language Bindings
    2
    9
    2167
    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.
    • J
      jihong last edited by

      I USE QTextCodec *pCodec = QTextCodec::codecForName("gb2312");
      AND pCodec = NULL

      "availableCodecs " by this function i got 117 .but there is no gb2312 .
      I Run QT soft in linux systerm .
      what 's the problem?

      JKSH 1 Reply Last reply Reply Quote 0
      • JKSH
        JKSH Moderators @jihong last edited by

        @jihong said:

        "availableCodecs " by this function i got 117 .but there is no gb2312 .
        I Run QT soft in linux systerm .
        what 's the problem?

        Your system doesn't have the GB2312 codec.

        Do you have ICU installed?

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        J 1 Reply Last reply Reply Quote 0
        • J
          jihong last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • J
            jihong @JKSH last edited by

            @JKSH
            Sorry ,I am not understand anything about ICU .what't ICU short for ? Is it a plugin that need install?
            where can i download ICU ? I did't serch anything about ICU in QT website.
            In linux terminal ,use" locale -e " ,we can got Gb2312
            Thank you for your reply.

            1 Reply Last reply Reply Quote 0
            • JKSH
              JKSH Moderators last edited by JKSH

              ICU stands for "International Components for Unicode". It is an external library. Qt 5 gets codecs from iCU.

              Search your Linux package manager for "ICU".

              Can you also tell us:

              1. What version of Linux do you have?
              2. How did you install Qt?

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              J 1 Reply Last reply Reply Quote 0
              • J
                jihong @JKSH last edited by

                @JKSH
                I Install ICU already ,but I got the same problem .
                linux version is 2.6.32-358.el6.x84-64
                I compile QT source and change environment variable
                I use the QT version 4.5.3 ..

                JKSH 1 Reply Last reply Reply Quote 0
                • JKSH
                  JKSH Moderators @jihong last edited by

                  @jihong said:

                  I Install ICU already ,but I got the same problem .
                  linux version is 2.6.32-358.el6.x84-64
                  I compile QT source and change environment variable
                  I use the QT version 4.5.3 ..

                  Sorry, I thought you were using Qt 5. Qt 4 does not support GB2312. It only supports the codecs listed at http://doc.qt.io/qt-4.8/qtextcodec.html#details

                  Can you use GB18030 instead?

                  If you want to support GB2312, I think you need to build Qt 5.5.1. Make sure ICU is enabled when you build Qt 5.

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  J 1 Reply Last reply Reply Quote 0
                  • J
                    jihong @JKSH last edited by

                    @JKSH
                    I Can't get GB18030 for " availableCodecs " in custorm't cmputer,
                    " QTextcode::availableCodecs " this function got totally 117 。
                    normally GB18030 is in 118 in our computers.and we got 142 for QTextcode::availableCodecs in our computer .
                    Both the computer has the same systerm

                    JKSH 1 Reply Last reply Reply Quote 0
                    • JKSH
                      JKSH Moderators @jihong last edited by

                      @jihong said:

                      I Can't get GB18030 for " availableCodecs " in custorm't cmputer,

                      Try Qt 5.

                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

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