dodo Posted July 18, 2006 Share Posted July 18, 2006 Hello,I want to write some character encoding conversion function, and I ran intoa problem: when I try to white characters in a string, I'm only able towrite the string in 16bit steps. Here is some code to illustrate theproblem:$string = "";$string .= chr(5);$string .= chr(6);the result will be a string containing these bytes: 05 00 06 00.I want to access the string in an 8 bit scope, so that the result will be 0506.If I enter data into the string using the [] operator, I have exactly thesame problem.I'm using PHP 4.4.3RC2-devThanks in advance,Oded. Quote Link to comment https://forums.phpfreaks.com/topic/14925-accesing-string-bytes/ Share on other sites More sharing options...
zq29 Posted July 18, 2006 Share Posted July 18, 2006 I'm not 100% sure on this, but I do have some thoughts:1) If you have [url=http://uk2.php.net/manual/en/ref.mbstring.php]mbstring[/url] running with PHP, can you force it to 8-bit mode?2) Would the [url=http://uk2.php.net/manual/en/language.operators.bitwise.php]Bitwise Operators[/url] be of any use you you here? Quote Link to comment https://forums.phpfreaks.com/topic/14925-accesing-string-bytes/#findComment-59873 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.