Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of incorrect work of the split string with the Cyrillic symbols #283

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MIVerTFT
Copy link

@MIVerTFT MIVerTFT commented Jul 3, 2020

Splitting a string containing the Cyrillic symbols using the gmatch method has wrong result, for example:

                s = 'Ррррр Нннннн Сссссс'
                words = {}
                for word in s:gmatch('%w+') do table.insert(words, word) end
                return words

Returns a table containing one row, although the correct result is three rows.

Added a solution to this problem and a couple of tests. I didn't quite understand why in KopiLua when working with strings char is often cast to byte, causes there is a loss of information, which leads to such bugs.

Мальцев Илья Владимирович added 2 commits July 3, 2020 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant