Results 1 to 2 of 2

Thread: QString unicode

  1. #1
    Join Date
    Aug 2014
    Posts
    28
    Thanks
    15
    Qt products
    Qt5
    Platforms
    Windows

    Default QString unicode

    i read in Qt docs about QString and found that QString supports unicode encoding but still when i write some stances in text file i see some "?" between words.
    the language that i use is part of unicode here this is my code.

    Qt Code:
    1. QFile dataF("fa.txt");
    2. dataF.open(QIODevice::WriteOnly | QIODevice::Append);
    3. QTextStream streamF(&dataF);
    4. streamF<<fa<<"\r\n";
    5. dataF.close();
    To copy to clipboard, switch view to plain text mode 

    im i miss something?
    best regards

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

    Default Re: QString unicode

    Quote Originally Posted by ramin.lich View Post
    im i miss something?
    You didn't tell Qt how to encode your data. See QTextStream::setCodec().
    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:

    ramin.lich (25th April 2015)

Similar Threads

  1. QString unicode replace
    By trallallero in forum Qt Programming
    Replies: 0
    Last Post: 26th June 2012, 14:57
  2. QString to unicode characters
    By jsmax in forum Newbie
    Replies: 1
    Last Post: 19th September 2011, 10:41
  3. QString to Unicode to char*
    By Daxos in forum Newbie
    Replies: 7
    Last Post: 4th November 2010, 17:56
  4. QString and Unicode
    By juanjo_de_la_pradera in forum Qt Programming
    Replies: 0
    Last Post: 23rd September 2010, 13:38
  5. QString unicode problem
    By kemp in forum Qt Programming
    Replies: 6
    Last Post: 21st September 2010, 15:11

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.