开发者

Check char size in utf8 encoding

Is there any simple solution to check on how m开发者_如何学编程any bytes are stored char in utf8.


If you have a string, then :

  • strlen() will give you the number of bytes it takes
  • while mb_strlen() will give you the number of characters it contains


strlen() returns the number of bytes. mb_strlen() returns the number of multibyte characters.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜