dandruff / xCT

A light weight scrolling combat text implementation.
53 stars 22 forks source link

string.sub function returns unvalid value on non-English client #71

Closed ghost closed 8 years ago

ghost commented 8 years ago

modules\combattext.lua : 499 ~ 501 lines are using string.sub function.

non-English client (I'm playing koKR client) display unvalid string.

for example, global string ACTION_SPELL_STOLEN is "훔침' in Korean.

but displayed string is "??침"

Cimplex commented 8 years ago

I wonder if it is actually the "string.upper" D:

Can you try this command in your chat:

    /dump string.upper(ACTION_SPELL_STOLEN)

I suspect it will just return question marks.

ghost commented 8 years ago

Dump: value=string.upper(ACTION_SPELL_STOLEN) [1]="훔침"

also, string.lower returns equal value

ghost commented 8 years ago

Dump: value=string.upper(string.sub(ACTION_SPELL_STOLEN, 1, 1)) [1]=""

Dump: value=string.sub(ACTION_SPELL_STOLEN, 1, 1) [1]="?"

This is because the Unicode UTF-8

http://www.wowace.com/addons/utf8/

I found helpful library addon that maybe solve this problem.

Cimplex commented 8 years ago

Hopefully this fixes your issue. It will be included in 4.1.7 88a4b87bb841e150e8d92ccae1dea7a987ef622a

ghost commented 8 years ago

It displayed correctly in new version

Thanks!