--- test.php ---
<?php
$string1 = "ą";
$string2 = "\xC4\x85";
var_dump($string1 == $string2)

How you expect one-character string to be equal to two-character string?

ą is in utf-8 (latin small letter a with ogonek, latin extended-a range).
It contains two bytes with 0xC4 0x85 values.

It contains two bytes in the filesystem. It however contains one character in PHP. In unicode mode, bytes and characters are different things. You could make $string2 as binary and then convert it from utf-8 to unicode, but without explicitly saying otherwise that string contains two characters - U+00C4 (LATIN CAPITAL LETTER A WITH DIAERESIS) and U+0085 (control character, no name). It doesn't mean escape sequences stop working, it means characters and bytes are no more the same. That's the price one has to pay for doing unicode.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to