Multi-byte strings and Japanese characters

From: Date: Thu, 26 Sep 2002 11:53:22 +0000
Subject: Multi-byte strings and Japanese characters
Groups: php.i18n 
Request: Send a blank email to php-i18n+get-329@lists.php.net to get a copy of this message
http://dk.php.net/manual/en/ref.mbstring.php claims that "a multi-byte character string may be destroyed when it is divided and/or counted unless multi-byte character encoding safe method is used". I've just run some tests with Unicode and Japanese characters (copied from http://unicode.org/unicode/standard/translations/japanese.html). I used functions like preg_match(), strlen(), and substr(), and no matter what I can't seem to break the Japanese strings. Which leads to my question: Is it really necessary to use functions like mb_substr() instead of substr(), mb_strlen() instead of strlen(), etc.? Does anyone have any examples of strings that would actually break if you use preg_match(), substr(), strlen() or similar functions on them?

« previous php.i18n (#329) next »