开发者

What is the difference between mblen and strlen?

What is the difference between mblen and strlen?

Is today multi-byte character encoding used in Windows, Linux or Mac OS? Is multi-byte character encoding开发者_JAVA技巧 same as fixed-width character encoding in Windows?


strlen takes the length of a const char *, and assumes that one char takes one byte, so it counts the chars until a null terminator ('\0') has been encountered, whereas mblen takes a pointer also of type const char *, but this points to the first byte of the multi byte character.

For more info on what are multi-bye characters, have a look at this question.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜