Results 1 to 2 of 2

Thread: Read utf-8(?) signs from file

  1. #1
    Join Date
    Jul 2015
    Posts
    20
    Thanks
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Read utf-8(?) signs from file

    I have a .txt file with some polish letters:
    żźćóę etc.

    I want to read the file contents, but it doesn't read these non-ASCII characters.

    QTextStream::setCodec("UTF-8") doesn't seem to work.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Read utf-8(?) signs from file

    I guess the file is not UTF8 encoded. Probably Windows code page 1250 or ISO-8859-2 (-13 or -16) You would need to check what the source was encoding with, or check the actual bytes in the file to work out which.

Similar Threads

  1. Replies: 6
    Last Post: 24th August 2015, 06:25
  2. QUrl with percent signs Issue
    By K_rol in forum Newbie
    Replies: 3
    Last Post: 21st February 2014, 05:32
  3. QTranslator and polish signs
    By damon_1990 in forum Newbie
    Replies: 0
    Last Post: 11th December 2011, 22:04
  4. Read contents from the file using QHTTP Read()?
    By Gokulnathvc in forum Newbie
    Replies: 2
    Last Post: 21st June 2011, 08:03
  5. is qt phonon can read realmedia file and divx file
    By fayssalqt in forum Qt Programming
    Replies: 1
    Last Post: 27th January 2009, 15:42

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.