Results 1 to 2 of 2

Thread: reading from QTextStream

  1. #1
    Join Date
    Dec 2006
    Posts
    1
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default reading from QTextStream

    Hi!

    I trying to use xml communication. This is the first tag I should read: "<connection>"
    Why is that, if I read from QTextStream (constructed with QTextStream ( QIODevice * ) ),
    I get this: "<onnection>"? The "c" is missing!
    If I read from the socket using socket->readBlock(buffer, socket->bytesAvailable()), I get the whole string "<connection>" correctly.

    Anybody seen this before?

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: reading from QTextStream

    It could be some sort of locale eating your characters. QTextStreams use the current locale to encode the data into unicode.

Similar Threads

  1. QTextStream capture stdout from xsltParseStylesheetFile
    By patrik08 in forum Qt Programming
    Replies: 9
    Last Post: 25th June 2006, 11:24
  2. Replies: 2
    Last Post: 4th May 2006, 19:17
  3. QSettings vs (QFile + Qtextstream)
    By nupul in forum Newbie
    Replies: 5
    Last Post: 10th April 2006, 07:26
  4. segfault on qtextstream
    By patcito in forum Qt Programming
    Replies: 13
    Last Post: 26th February 2006, 13:10
  5. qtextstream & qstring
    By mickey in forum Newbie
    Replies: 3
    Last Post: 24th February 2006, 19:18

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.