Questions tagged [rawbytestring]
15 questions
59
votes
8 answers
C/C++ Why to use unsigned char for binary data?
Is it really necessary to use unsigned char to hold binary data as in some libraries which work on character encoding or binary buffers? To make sense of my question, have a look at the code below -
char c[5], d[5];
c[0] = 0xF0;
c[1] = 0xA4;
c[2] =…

nightlytrails
- 2,448
- 3
- 22
- 33
5
votes
2 answers
Delphi 2009 RawByteString vagaries
Suppose that for some perverse reason you want to display the raw byte contents of a UTF8String.
var
utf8Str : UTF8String;
begin
utf8Str := '€ąćęłńóśźż';
end;
(1) This doesn't do, it displays the readable form:
memo1.Lines.Add(…

Marek Jedliński
- 7,088
- 11
- 47
- 57
3
votes
1 answer
Split a string and keep the delimiters as part of the split string chunks, not as separate list elements
This is a spin-off from In Python, how do I split a string and keep the separators?
rawByteString = b'\\!\x00\x00\x00\x00\x00\x00\\!\x00\x00\x00\x00\x00\x00'
How can I split this rawByteString into parts using "\\!" as the delimiter without dropping…

questionto42
- 7,175
- 4
- 57
- 90
3
votes
5 answers
Using numpy.genfromtxt gives TypeError: Can't convert 'bytes' object to str implicitly
I have a project in python that is from kaggle.com. I am having problems reading in the data set. It has one csv file. We need to read it in and put the target and train parts of it in arrays.
Here are the first 3 rows of data set (the target…

user3451169
- 51
- 1
- 3
2
votes
2 answers
Delphi (FMX): DCPCrypt2 in Windows produces different result in Android/IOS
I am trying to write a function that returns the same result in Delphi (RAD Studio 10.2) as the following piece of code in PHP:

Rob
- 155
- 1
- 12
2
votes
2 answers
RawByteString type in Free Pascal
Free Pascal docs state that RawByteString type is defined in Free Pascal but I cannot find where. One should expect that it is defined in System unit, like in Delphi, but when I compile (using FPC 2.6.2, {$mode delphi}) a function declaration
class…

kludg
- 27,213
- 5
- 67
- 118
1
vote
0 answers
How Strings are converted into bytes in Python and Encoding?
Recently I found the following code for a specific problem on a coding platform.
exec(bytes('㵔湩異ੴ㵦慬扭慤洺灡椨瑮听⤨献汰瑩⤨ⱸ㵹⡦㵤慛獢砨稭⬩扡⡳⥴潦ⱺ⁴湩汛獩⡴⡦⤩潦湩‧⨧湩⡴⡔⤩嵝瀊楲瑮搨椮摮硥洨湩搨⤩ㄫ洬湩搨⤩','u16')[2:])
I was completely shocked when I saw it the first time.
Then I tried…

mhpd
- 31
- 5
1
vote
1 answer
Python Struct Library appending unwanted Char 'L'
I'm trying to write a simple serialization library for some messages. I have it working and everything is good, but for some reason it keeps appending an 'L' to the end of certain messages. Literally never any other character, always an L, and…

Broccolli Rob
- 15
- 3
1
vote
2 answers
Convert raw byte string to Unicode without knowing the codepage beforehand
When using the right-click menu context, windows passes file path as raw (byte) string type.
For example:
path = 'C:\\MyDir\\\x99\x8c\x85\x8d.mp3'
Many external packages in my application are expecting unicode type strings, so I have to convert it…

iTayb
- 12,373
- 24
- 81
- 135
0
votes
4 answers
How to read floating point value from raw bytes in memory?
I am trying to read a floating point value from a raw bytes array. I have a pointer to the raw bytes array and I would like to read the floating point value associated with the raw bytes. I am using a union data structure to read the floating point…

Nimit Singhania
- 3
- 1
0
votes
0 answers
Hexadecimal and words mixed in Python bytes
I'm receiving frames from a websocket server and I'm not sure how to interpret some of the bytes object because they are mixed with actual words inside them.
I get something like this:
…

mp808
- 21
- 3
0
votes
0 answers
Can a rawbytes image be reduced in size and converted to be stored on a database?
I've been making the create account and edit profile page for a kony app. The information of the created server is stored on a server.
My problem is, the profile picture that is captured by the phone or imported from the gallery is much bigger than…

Barry Michael Doyle
- 9,333
- 30
- 83
- 143
0
votes
0 answers
PHP working with input from a tracking devices in raw bytes format
A tracking device is sending me live tracking information in bytes format. The size of the bytes is 70 bytes. Its in multibyte format and not single byte.
The integration document suggests the valid format of input…

user3314040
- 1
- 1
0
votes
2 answers
Delphi 2009 - Implicit string to RawByteString conversion warnings
I have just got my hands on D2009 and using it with one of our existing projects - it all compiles fine however I have just picked up DIRegEx to use some regex in the project.
However it's always giving warnings about String to RawByteString and…

Wizzard
- 12,582
- 22
- 68
- 101
-3
votes
1 answer
TIdTCPServer/TIdTCPClient: the best way to transfer a RawByteString?
I'm looking for a most fastest (stock market application, extremely time critical) solution for transfer a lot of encrypted RawByteString-data (up to 500 records/s, ) from TIdTCPServer to TIdTCPClient.
What is the best way to do that?
Thanks in…

vitaliy-zh
- 185
- 9