Answer the question
In order to leave comments, you need to log in
LUA | Counting Russian characters?
Here I ran into a problem ...
When counting Unicode (for example, "yalaya"), it gives out not 4 but 8. I know that there are 2 bytes in a Russian character, and I tried to divide by 2 ... But there is another problem - if in the text there will be English letters or spaces, then this method immediately disappears ...
Answer the question
In order to leave comments, you need to log in
To count Cyrillic characters , you need to determine the characters whose code points are in the range U+0410 - U+044F, not including ё (U+0451), Ё (U+0401).
Also, the statement is not always true.
I know that there are 2 bytes in a Russian charactersince this is a special case depending on the choice of encoding.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question