CompareStr() and binary data

Report any Hollywood bugs here
Post Reply
Flinx
Posts: 342
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

CompareStr() and binary data

Post by Flinx »

Hello,
I'm not sure if I am allowed to call this a bug, but when I use CompareStr() with #ENCODING_RAW, I was hoping it would do a binary data comparison, but the strings are zero-terminated.
If this is intentional, I would mention it in the manual.

Code: Select all

DebugPrint(CompareStr("Exif\0\2","Exif\0\0", True, #ENCODING_RAW))
User avatar
airsoftsoftwair
Posts: 5833
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: CompareStr() and binary data

Post by airsoftsoftwair »

I think this is intentional. As mentioned here #ENCODING_RAW is just a synonym for #ENCODING_ISO8859_1 (both constants have the same value 0) so there is no way to make #ENCODING_RAW behave different than #ENCODING_ISO8859_1.
Post Reply