starwing / luautf8

a utf-8 support module for Lua and LuaJIT.
MIT License
406 stars 67 forks source link

utf8.find not working on android in russian #11

Closed jalomic closed 4 years ago

jalomic commented 7 years ago
local test_remove = "АБВГДИКЛМНОПРСТ"
local remove_word = "ГДИК"

local word_start, word_end = utf8.find(test_remove, remove_word,1, true) --word_start and word_end are nil

on Mac OS all OK

starwing commented 7 years ago

okay, I will look into this issue :)

starwing commented 7 years ago

p.s. your script file should in UTF-8 encoded, can you offer a file for test? thanks :)

SDraw commented 7 years ago

Checked with CP-1251 and UTF-8 encoding on Windows with Russian language as default, no problems have occured. Added: Oops, it's Android issue. My bad...

starwing commented 7 years ago

I have not android environment, but in my macOS it seems all right. maybe you should check whether the source file is in UTF-8 encode first?

jalomic commented 7 years ago

Checked on windows and mac os, no problem have occured too =) but damn android !

starwing commented 7 years ago

but why? I use the charset that parsed from Unicode Database, not specified by any system. it impossible working on Desktop but not on mobile :-(

can you give Android test case (apk file and source text file in assets of ask) and I have a try?

you could make a apk, read file in assets, and use lua-utf8 to show the result, and I could replace this file to see difference.