I'm working on a script that I've run into a bit of an issue with.
The script expects strings to be passed to it in byte data. As an example, I have the string:
61,68,71,61,68,101,118,105,101,116,104
which turns out to be =DG=Devieth. The following code takes that line and translates it successfully:
$sv_reportee = implode(array_map('chr', explode(',', $_GET['defendant'])));
Now, let's say I change that string to contain 171 («) and 187 (»). The script spits out no warnings, no notices, or anything... it just refuses to do any more work in terms of working with variables. It'll run the other functions through just fine, but running print($sv_reportee) results in absolutely nothing coming for that variable at all.
This was my reference for the above line of code: PHP Get String Text From Bytes
Now, from what I understand, chr() should be able to handle from 0-255 on the ASCII table. Right? Or is there another way that I should be/could be doing this that doesn't involve the above line of code?
Worth mentioning, due to a limitation in another aspect of the application, the string must be sent in byte form. There's unfortunately no other way around this - we've exhausted all of our other possible options.