Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Why Qbytearray.mid() method remove charactor "0D" from new QBytearray
Forum Updated to NodeBB v4.3 + New Features

Why Qbytearray.mid() method remove charactor "0D" from new QBytearray

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 521 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • stackprogramerS Offline
    stackprogramerS Offline
    stackprogramer
    wrote on last edited by
    #1

    Hi, when I used the method Qbytearray.mid() it remove the "0D" character or white space how I can solve this problem...I want to account for all characters.......
    Thanks in advance

    QByteArray tempRealByteArray=fileByteArray.mid(0+i,4);
    
    JonBJ 1 Reply Last reply
    0
    • stackprogramerS stackprogramer

      Hi, when I used the method Qbytearray.mid() it remove the "0D" character or white space how I can solve this problem...I want to account for all characters.......
      Thanks in advance

      QByteArray tempRealByteArray=fileByteArray.mid(0+i,4);
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @stackprogramer
      This is simply not so. QByteArray::mid() does not "remove" any characters, it returns precisely whatever characters are there. If you think characters/bytes have been removed you are mistaken, you must be doing something afterward (or before) which removes them, or they are there and you are failing to see them. Show exactly what makes you think they are missing.

      1 Reply Last reply
      4
      • C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        If you have created the content of the QByteArray using a QIODevice in QIODevice::Text mode then carriage returns may be removed on read and added on write (depending on platform). Do not use text mode if you want verbatim data.

        stackprogramerS 1 Reply Last reply
        4
        • C ChrisW67

          If you have created the content of the QByteArray using a QIODevice in QIODevice::Text mode then carriage returns may be removed on read and added on write (depending on platform). Do not use text mode if you want verbatim data.

          stackprogramerS Offline
          stackprogramerS Offline
          stackprogramer
          wrote on last edited by
          #4

          @ChrisW67 exactly my problem was QIODevice::Text ...
          thanks

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved