Results 1 to 3 of 3

Thread: How to read Hebrew characters from DB and write them in QTableWidget?

  1. #1
    Join Date
    Jan 2012
    Posts
    15
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default How to read Hebrew characters from DB and write them in QTableWidget?

    Hello!

    I am writing a Qt application. Also I use MS SQL Server 2008. There are data in Hebrew language. I have to read them with QSqlQuery and put them into a QTableWidget. After this writing I have "?????" instead of "טיפקס" e.g. in a corresponding item. I tried to use trUtf8 and QByteArray but I still have problems. Please, help me.

    Joshua

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to read Hebrew characters from DB and write them in QTableWidget?

    Encoding is always a mess. Have you set the local of the MS SQL Server right? Try if QString::fromUtf8(), QString::fromLocal8Bit() or QString::fromLatin1() can solve your problem.

  3. #3
    Join Date
    Jan 2012
    Posts
    15
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: How to read Hebrew characters from DB and write them in QTableWidget?

    Thank you, Lykurg, for your help.
    No, I have not set the local of the MS SQL Server yet. I have already tried QString::fromUtf8() but there is no good results.
    The only case when everything works fine is when one has e.g. "QByteArray encode = "\05E4\05E2\05E9";". But in my database there are "????" instead of characters and they are on my widgets hence.
    Anyway, I will try to follow your advices, thanks again.

Similar Threads

  1. QTextStream cannot read £ characters?
    By KjellKod in forum Qt Programming
    Replies: 10
    Last Post: 15th August 2011, 15:58
  2. Replies: 2
    Last Post: 2nd November 2010, 06:15
  3. QTableWidget Headers don't hangle accentuated characters
    By tuthmosis in forum Qt Programming
    Replies: 2
    Last Post: 28th May 2010, 18:17
  4. read an xml file with Asian characters in QTextEdit
    By Boris Liao in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2010, 23:56
  5. Replies: 13
    Last Post: 10th October 2007, 16:38

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.