Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Extended Ascii Codes in QTextEdit

Extended Ascii Codes in QTextEdit

Scheduled Pinned Locked Moved Solved General and Desktop
22 Posts 3 Posters 14.7k 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.
  • M Offline
    M Offline
    mulfycrowh
    wrote on last edited by kshegunov
    #13

    I found this table:

    alt text

    and you get the characters with the matching decimal code

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mulfycrowh
      wrote on last edited by
      #14
      This post is deleted!
      1 Reply Last reply
      0
      • M Offline
        M Offline
        mulfycrowh
        wrote on last edited by
        #15
        This post is deleted!
        1 Reply Last reply
        0
        • M Offline
          M Offline
          mulfycrowh
          wrote on last edited by
          #16

          Explanation: I have a file with hex bytes equal to 93, 94, 96 ... and I would like to display the matching characters into a QTextEdit.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mulfycrowh
            wrote on last edited by
            #17

            I found the solution in adding fromLatin1()

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mulfycrowh
              wrote on last edited by
              #18

              With fromLatin1(), it's better: I have no more losange with ? but, for example hex codes 93 and 94 are not displayed.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mulfycrowh
                wrote on last edited by
                #19

                From Wikipedia, I copy and paste some text.
                In this text I have the character (Hex 92) (') and the character (Hex E9) (é).
                The second one is displayed. The first one is replaced by a chinese character.
                Why ?

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mulfycrowh
                  wrote on last edited by
                  #20

                  I think having found the perfect solution :)

                  I copied and pasted many articles from Wikipedia in French, English and German and it runs.
                  The solution is to use:

                  FromLocal8Bit()
                  
                  kshegunovK 1 Reply Last reply
                  1
                  • M mulfycrowh

                    I think having found the perfect solution :)

                    I copied and pasted many articles from Wikipedia in French, English and German and it runs.
                    The solution is to use:

                    FromLocal8Bit()
                    
                    kshegunovK Offline
                    kshegunovK Offline
                    kshegunov
                    Moderators
                    wrote on last edited by
                    #21

                    As long as it works for you. I wouldn't depend on the local 8bit encoding myself, but that's just me.

                    Read and abide by the Qt Code of Conduct

                    M 1 Reply Last reply
                    1
                    • kshegunovK kshegunov

                      As long as it works for you. I wouldn't depend on the local 8bit encoding myself, but that's just me.

                      M Offline
                      M Offline
                      mulfycrowh
                      wrote on last edited by
                      #22

                      @kshegunov That's the only way to make it perfectly running. Do you have other idea in mind ?

                      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