[dokuwiki] Re: UTF-8 library (@harry)

Hi Andreas,

That someone is partly correct and I did write
http://www.phpwact.org/php/i18n/utf-8.

explode() for example I initially implemented (which is why you have)
and only later figured out it's not needed (assuming well formed
UTF-8) - think I told you in fact, but as part of a bigger email
exchange we were having at the time. Specifically;

- substr_replace()

Wrong - this you do need to re implement because of the third and
fourth arguments (start, length) - for the native PHP function these
integers represent a number of bytes, not characters.

- explode()

Right - you don't need to reimplement

- str_replace()

Right - you don't need to reimplement

- ltrim()
- rtrim()
- trim()

You only need to re-implement if you are supplying the 2nd charlist
optional arg _and_ it contains UTF-8 characters.

Hope that helps.
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: