Results 1 to 10 of 10

Thread: Display problem of Arab QString increased from C ++ to QML

  1. #1
    Join Date
    Jul 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Smile Display problem of Arab QString increased from C ++ to QML

    when I receive Arabic data from my database, and I want them displayed in a QML file I get movaises characters
    noted that it works for the Arabic data inserssion by QML into my Mysql
    noted that database MySQL's in UTF8
    Last edited by amone; 9th July 2016 at 15:22.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Display problem of Arab QString increased from C ++ to QML

    Is the font capable of displaying the characters?
    Does the UI show arabic when you generate the string programmatically?
    When you get the string from the database, rencode it with QString::toUtf8() and write that into a file, can am UTF-8 capable text editor show the correct text?

    Cheers,
    _

  3. #3
    Join Date
    Jul 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Display problem of Arab QString increased from C ++ to QML

    QML pages displaying Arabic except for the string sent by Cpp
    I have already used toUTF8 () but the problem remains

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Display problem of Arab QString increased from C ++ to QML

    Quote Originally Posted by amone View Post
    QML pages displaying Arabic except for the string sent by Cpp
    "sent" as in property, model or signal=

    Quote Originally Posted by amone View Post
    I have already used toUTF8 () but the problem remains
    [/quote]
    Not sure what you mean, that wasn't going to change anything, it is for verifying that the string is indeed what you think it is.

    Which program did you use to read the file that you've created with that toUtf8() output?

    Cheers,
    _

  5. #5
    Join Date
    Jul 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Display problem of Arab QString increased from C ++ to QML

    I'll try detailer well, my project is composed of two parts, one side create by J2E with Sprin for data processing in Arabic and French, and the other party creates with qt / qml for consomation processed data (select and insert the data located in DB side J2E) via the web service (Casablanca)
    when I insert data in Arabic via qml form with POST method data are stored in my DB but when I selected the Arabic data in my DB and displayed in the application qml they are poorly displayed
    I use the IDE Visual Studio 2013 for the establishment of application qt / qml

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Display problem of Arab QString increased from C ++ to QML

    So your QML application uses a web service API for writing and reading the database?

    Is the text correct in the database?
    Is the text, as received in the web API response, correct?

    Cheers,
    _

  7. #7
    Join Date
    Jul 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Display problem of Arab QString increased from C ++ to QML

    Yes, data is stored in the database correctly, even if I filled a QML Arabic form and sent it to the DB I found it stored in the database correctly, the problem so just display data received from my database
    I have noted that a QString essyer displayed in Arabic in the consol of VS2013 always shows me ??? even with the use of toUtf8 () or fromUtf8 ()

  8. #8
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Display problem of Arab QString increased from C ++ to QML

    It the string is correctly stored in the database as verified by an external tool, you'll need to check if the string is correct in the Web API response.
    If it is, check if the code that extracts the string from the response.
    Then check the extracted value.

    Cheers,
    _

  9. #9
    Join Date
    Jul 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Display problem of Arab QString increased from C ++ to QML

    same for this simple code
    qDebug () << (QString::fromUTF8(QString("البت")));
    or
    qDebug () << (QString::fromUtf8 (QString ("البت").toUtf8 ()).);
    the consol displays
    ????

  10. #10
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Display problem of Arab QString increased from C ++ to QML

    The first line make no sense, a QString is never in UTF-8, the second line is just unnecessary double conversion.

    Looks like the console can't display arabic symbols or the local 8 bit encoding this encodes do can't.

    Which obviously means you can't use it to check your values.

    Cheers,
    _

Similar Threads

  1. Replies: 5
    Last Post: 16th March 2016, 22:55
  2. Replies: 3
    Last Post: 27th December 2013, 19:04
  3. Replies: 3
    Last Post: 27th July 2012, 10:30
  4. Replies: 2
    Last Post: 11th August 2011, 16:42
  5. Replies: 4
    Last Post: 31st January 2008, 21:44

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.