Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. "codecForName " use this function i can't get anything for GB2312
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved Language Bindings
9 Posts 2 Posters 2.9k Views 1 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.
  • J Offline
    J Offline
    jihong
    wrote on last edited by
    #1

    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?

    JKSHJ 1 Reply Last reply
    0
    • J jihong

      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?

      JKSHJ Online
      JKSHJ Online
      JKSH
      Moderators
      wrote on last edited by
      #2

      @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
      0
      • J Offline
        J Offline
        jihong
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • JKSHJ JKSH

          @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?

          J Offline
          J Offline
          jihong
          wrote on last edited by
          #4

          @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
          0
          • JKSHJ Online
            JKSHJ Online
            JKSH
            Moderators
            wrote on last edited by JKSH
            #5

            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
            0
            • JKSHJ 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?
              J Offline
              J Offline
              jihong
              wrote on last edited by
              #6

              @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 ..

              JKSHJ 1 Reply Last reply
              0
              • J jihong

                @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 ..

                JKSHJ Online
                JKSHJ Online
                JKSH
                Moderators
                wrote on last edited by
                #7

                @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
                0
                • JKSHJ JKSH

                  @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.

                  J Offline
                  J Offline
                  jihong
                  wrote on last edited by
                  #8

                  @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

                  JKSHJ 1 Reply Last reply
                  0
                  • J jihong

                    @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

                    JKSHJ Online
                    JKSHJ Online
                    JKSH
                    Moderators
                    wrote on last edited by
                    #9

                    @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
                    0

                    • Login

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