Results 1 to 9 of 9

Thread: How to decode string to human readable format

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    May 2019
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to decode string to human readable format

    Quote Originally Posted by anda_skoa View Post
    A "word" in such a context is usually not a string but a number, a two byte integer.

    For parsing such numbers you will need to know which of the two bytes has the higher value.
    This can either be the first (also referred to as Big Endian) or the second (also referred to as Little Endian).

    You then take each byte and put it in the correct position of a large enough integer type, usually by setting the higher byte first, shifting it by 8 bits and then adding the lower byte.

    Cheers,
    _
    And what does Z at the beginning mean?

    Also I can use QByteArray to read byte by byte anyway. But can you explain why the whole size is 511? Perhaps it should be 249?


    Added after 39 minutes:


    Also what does "bits 15:3" for example mean?
    This binary file contains device identification information
    Last edited by Mikhail86; 11th May 2019 at 10:15.

Similar Threads

  1. getting a string value back from long converted format
    By prachi kamble in forum General Programming
    Replies: 0
    Last Post: 1st February 2016, 07:05
  2. QDateTime application level format string
    By davidovv in forum Qt Programming
    Replies: 12
    Last Post: 10th March 2013, 15:53
  3. XML human readable string.
    By m.p in forum Qt Programming
    Replies: 1
    Last Post: 15th July 2011, 13:24
  4. Replies: 5
    Last Post: 19th November 2010, 02:25
  5. Human-Human playable game over Internet
    By A.H.M. Mahfuzur Rahman in forum KDE Forum
    Replies: 0
    Last Post: 2nd August 2009, 03:26

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
  •  
Qt is a trademark of The Qt Company.