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. QString convert unicode
QtWS25 Last Chance

QString convert unicode

Scheduled Pinned Locked Moved Solved General and Desktop
19 Posts 4 Posters 9.4k Views
  • 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.
  • K kshegunov
    4 Nov 2016, 22:29

    You really should check the docs on this.
    I've made a minor mistake, but it's easily correctable.

    QByteArray utf8data = string.toUtf8();
    const char * utf8encoded = utf8data.constData();
    
    J Offline
    J Offline
    Jeronimo
    wrote on 4 Nov 2016, 22:53 last edited by
    #8

    @kshegunov said in QString convert unicode:

    QByteArray utf8data = string.toUtf8();
    const char * utf8encoded = utf8data.constData();

    one question normally i think must show unicode text like this :

    Normally i can do this
    QString::fromUtf16((ushort*)buffer)

    But i have one problem with this only show me in unicode when i am using some modificator like ctrl. It's for one keyboard in different languages.

    K 1 Reply Last reply 5 Nov 2016, 17:48
    0
    • J Jeronimo
      4 Nov 2016, 22:53

      @kshegunov said in QString convert unicode:

      QByteArray utf8data = string.toUtf8();
      const char * utf8encoded = utf8data.constData();

      one question normally i think must show unicode text like this :

      Normally i can do this
      QString::fromUtf16((ushort*)buffer)

      But i have one problem with this only show me in unicode when i am using some modificator like ctrl. It's for one keyboard in different languages.

      K Offline
      K Offline
      kshegunov
      Moderators
      wrote on 5 Nov 2016, 17:48 last edited by
      #9

      I don't understand the question. Unicode has little to do with control or with the keyboard, it's an encoding for text, not a device driver ...

      Read and abide by the Qt Code of Conduct

      J 1 Reply Last reply 5 Nov 2016, 18:15
      0
      • K kshegunov
        5 Nov 2016, 17:48

        I don't understand the question. Unicode has little to do with control or with the keyboard, it's an encoding for text, not a device driver ...

        J Offline
        J Offline
        Jeronimo
        wrote on 5 Nov 2016, 18:15 last edited by
        #10

        @kshegunov i think is problem of my instance or i'm doing something wrong.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 5 Nov 2016, 21:39 last edited by
          #11

          Hi,

          Then tell us what you are trying to do.

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

          J 1 Reply Last reply 5 Nov 2016, 21:51
          0
          • S SGaist
            5 Nov 2016, 21:39

            Hi,

            Then tell us what you are trying to do.

            J Offline
            J Offline
            Jeronimo
            wrote on 5 Nov 2016, 21:51 last edited by
            #12

            @SGaist Sorry i said instance¿? i wanted to say encoding*

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 5 Nov 2016, 22:08 last edited by
              #13

              That still doesn't explain what you are trying to do.

              Why do you need all these conversion ?

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

              J 1 Reply Last reply 5 Nov 2016, 22:39
              1
              • S SGaist
                5 Nov 2016, 22:08

                That still doesn't explain what you are trying to do.

                Why do you need all these conversion ?

                J Offline
                J Offline
                Jeronimo
                wrote on 5 Nov 2016, 22:39 last edited by
                #14

                @SGaist i'm trying to do keyboard in different languages and like i was trying to show key's in other languages like(german or others..) i couldn't because i can't get unicode text to translate it.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 5 Nov 2016, 22:51 last edited by
                  #15

                  Something like the QtVirtualKeyboard module ?

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

                  J 1 Reply Last reply 5 Nov 2016, 23:16
                  1
                  • S SGaist
                    5 Nov 2016, 22:51

                    Something like the QtVirtualKeyboard module ?

                    J Offline
                    J Offline
                    Jeronimo
                    wrote on 5 Nov 2016, 23:16 last edited by
                    #16

                    @SGaist Nope it's for windows so i am using setwindowshookex

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 5 Nov 2016, 23:20 last edited by
                      #17

                      Why not make use of Window's virtual keyboard ?

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

                      J 2 Replies Last reply 6 Nov 2016, 00:16
                      1
                      • S SGaist
                        5 Nov 2016, 23:20

                        Why not make use of Window's virtual keyboard ?

                        J Offline
                        J Offline
                        Jeronimo
                        wrote on 6 Nov 2016, 00:16 last edited by Jeronimo 11 Jun 2016, 00:16
                        #18
                        This post is deleted!
                        1 Reply Last reply
                        0
                        • S SGaist
                          5 Nov 2016, 23:20

                          Why not make use of Window's virtual keyboard ?

                          J Offline
                          J Offline
                          Jeronimo
                          wrote on 6 Nov 2016, 00:26 last edited by Jeronimo 11 Jun 2016, 18:52
                          #19

                          @SGaist Anyways i'm checking virtual keyboard thx

                          1 Reply Last reply
                          0

                          17/19

                          5 Nov 2016, 23:20

                          • Login

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