Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- PHP 6 and non-unicode strings
August 6, 2008, 7:11 pm
rate this thread
chr(45)) and then unpacks them (eg. unpack('N4'), or whatever).
Since PHP 6, however, uses unicode strings, I'm kinda worried that PHP
6 might break my program. Since I am needing to manipulate strings on
a byte level as opposed to a character level, I don't want $var to
return a two byte character - I want it to return a single byte
My question is... what can I do to fix this?
I'd rather not do something like ini_set because, although the
library, itself, may use byte strings, the script including the
library might not.
Re: PHP 6 and non-unicode strings
My guess is that there is a native Unicode string type, for human-
readable text, and a distinct binary string type, for applications
such as yours. Presumably, fread('bla', 'rb') would return the binary
type (because of the 'b'), or you may cast it to the right type.