Results 1 to 5 of 5

Thread: Passing Specific Binary Characters in QTcpSocket.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: Passing Specific Binary Characters in QTcpSocket.

    That is because you write unicode characters to the data stream.
    What you need is to write ascii characters:
    Qt Code:
    1. QString s = "text";
    2. QByteArray b = s.toAscii();
    3. const char* ascii = b.constData();
    4. out << int(0x02) << ascii;
    To copy to clipboard, switch view to plain text mode 


    Regards

  2. The following user says thank you to marcel for this useful post:

    nbkhwjm (2nd September 2007)

Similar Threads

  1. Problem at time compilation in traslation of language
    By thomasjoy in forum Qt Programming
    Replies: 3
    Last Post: 22nd May 2007, 14: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
  •  
Qt is a trademark of The Qt Company.