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 same as fixed-width character encoding in Windows?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
strlentakes the length of aconst char *, and assumes that onechartakes one byte, so it counts the chars until a null terminator (‘\0’) has been encountered, whereasmblentakes a pointer also of typeconst 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.