View Single Post

  #2 (permalink)  
Old 09-05-2004
Alvaro G. Vicario
 
Posts: n/a
Default Re: Problem with length of Multibyte String

*** lian escribió/wrote (Sun, 05 Sep 2004 17:27:28 +0800):
> Problem happened on function "strlen". utf-8 string consists of
> multibye characters. Every characters have more than one byte. But to
> function "strlen", every character is just one byte.


There's a chapter in PHP manual titled "Multi-Byte String Functions". There
you have info about mb_strlen().

It's an extension so if it isn't installed in your server you'll probably
have to write your own function. There're some user comments about it in
strlent() manual page.

In any case, please note that the length parameter in fwrite is optional.
If not set, it'll write the whole string.

--
--
-+ Álvaro G. Vicario - Burgos, Spain - ICQ 46788716
+- http://www.demogracia.com (la web de humor para mayores de 100 años)
++ «Sonríe, que te vamos a hacer una foto para la esquela»
--
Reply With Quote