Skip to content

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

Open
MIVerTFT wants to merge 2 commits intomoonsharp-devs:legacy/2.0from
MIVerTFT:master
Open

Fix of incorrect work of the split string with the Cyrillic symbols#283
MIVerTFT wants to merge 2 commits intomoonsharp-devs:legacy/2.0from
MIVerTFT:master

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
@Benjamin-Dobell Benjamin-Dobell changed the base branch from master to legacy/2.0 March 3, 2026 06:59
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