Answer the question
In order to leave comments, you need to log in
String length with different letter case?
Hello!
Whether the length of a string with the same characters, but with a different letter case, will be the same.
Interested in the result of the strlen function.
As I understand it, Latin characters occupy one byte, any other non-Latin character is always two bytes?
Answer the question
In order to leave comments, you need to log in
Case does not affect the number of characters or the number of bytes.
PS The number of bytes depends on the type of encoding (for example, Cyrillic in win-1251 - 1 byte, in utf-8 - 2 bytes). Counting bytes is rarely necessary. Usually count the number of characters - use mb_strlen.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question