Results 1 to 4 of 4

Thread: is there QUtf8String similar as QLatin1String?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2011
    Location
    Karlsruhe, Germany
    Posts
    57
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default is there QUtf8String similar as QLatin1String?

    as the documentation stated in QLatin1String, it is a wrapper class to fasten the construction rather than calling QString(),
    in my project the QLatin1String is not sufficient since many characters are e.g. "ü", "ä", ...

    that's why im searching for a class like QUtf8String which specifically for utf8 string. However, seems like qt didnt offer such a class.
    any one knows some classes like that in QT? maybe in different fancy name that I couldnt notice... thank you.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: is there QUtf8String similar as QLatin1String?

    QString::fromUtf8(). Or QStringLiteral in Qt5.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    cic (17th June 2013)

  4. #3
    Join Date
    Nov 2011
    Location
    Karlsruhe, Germany
    Posts
    57
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: is there QUtf8String similar as QLatin1String?

    thx, @wysota.

    Since im still using qt 4.8 currently, i think i need to make similar macro by using fromUtf8() in the code, cause there are more than thousand positions which i used QLatin1String("....") already.

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: is there QUtf8String similar as QLatin1String?

    Search and replace is your friend. However be aware that using fromUtf8() will not speed up your strings -- each call to that function will construct a real QString from utf-8 data. It only makes sure your strings are encoded properly.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Get the 'My documents' directory or similar
    By qt_developer in forum Qt Programming
    Replies: 2
    Last Post: 24th April 2013, 16:37
  2. Looking for similar structure in QT
    By tarakm87 in forum Newbie
    Replies: 1
    Last Post: 22nd March 2013, 16:11
  3. -nograb does not work - need something similar
    By btux in forum Qt Programming
    Replies: 0
    Last Post: 13th December 2009, 15:37
  4. Something similar to WS_GROUP in Qt?
    By zoeker in forum Qt Programming
    Replies: 1
    Last Post: 27th June 2008, 22:22
  5. are they similar in performance ?
    By Gopala Krishna in forum General Programming
    Replies: 3
    Last Post: 12th January 2008, 19:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.