Jump to content

The library string doesn't work normally


Recommended Posts

Hello guys! I'm sorry for my bad English, but I'm Russian. I have a problem. For the Library string any Russian symbol is two symbols. For example:

Code: 
outputDebugString(tostring(string.len("кекс")) 
In logs: 
8 

The second example:

Code: 
outputDebugString(tostring(string.len("кекс1и к")) 
In logs: 
14 

It is the cause of many difficulties, when I'm working with the library string. I will must count every Russian symbol if I want to use the library string. When I want to use automatical function to work with the library, it is the hell.

Example:

I want to print the first six symbols. ("Яы5 бю") Now I can't do it automatical. I must do it by hand.

Code: 
outputDebugString(string.sub("Яы5 бю ядовит",1, 10)) 
How I was thinking: 
The first symbol is "Я". It is Russian symbol  
The second symbol is "ы". It is Russian symbol 
The third symbol is "5". It is not Russian symbol 
The fourth symbol is " ". It is not Russian symbol 
The fifth symbol is "б". It is Russian symbol 
The sixth symbol is "ю". It is Russian symbol 
In total, there are 4 Russian symbols and 2 other symbols. 4*2 + 2 is 10. It's bored. 

Please, say me how can I fix it? I want Russian symbol to be 1 symbol too.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...