Global Search

Global Search

12.7k Downloads

encoding issue?

EKE00372 opened this issue · 7 comments

commented

for example searching 炉石(hearthstone) and show 爆裂熔炉(Blast Furnace) as related
image
image

commented

This is probably an issue with Korean and Russian as well. Unfortunately, there's no easy solution to this, since the version of Lua that WoW uses does not support UTF8. There are some UTF8 libraries, but I doubt the performance would be sufficient when UTF8 functions are implemented in pure Lua when compared to the standard library's C implementation.

Another issue with Chinese is that determining word boundaries is a lot more complicated due to the lack of spaces. In addition to the main search that works per character, GlobalSearch also searches by word, including text in tooltips, and orders the results by the number of matching words. I guess for Chinese, it could go by number of matching characters rather than words, and while not ideal, it may work okay in practice.

I'll probably look into this at some point, but since it's possible that there is no good solution, I'm not really motivated to prioritize this.

commented

I ran some benchmarks and it turns out I vastly overestimated how fast string.find is compared to a for loop, so this should actually be doable.

commented

Please give the latest alpha version a try and let me know if you encounter any issues.

commented

version v0.22.9-3-gedfa66d
works fine

version v0.22.9-11-gf1d6aea
get error when alt+space
AddOns/GlobalSearch/Internal/Unicode/UTF8.lua:33: bad argument #1 to 'band' (number expected, got nil)

commented

Should be fixed as of d0f0313. If you can confirm it's working for you now, I'll go ahead and do a release.

commented

It works fine now.

ps. checking translate but strings in curse localization page is incomplete. should I pull request here?

commented

No, I just forgot to put the strings on curseforge. They're added now. Thanks.