Chinese LOCALE and string.sub
Hi all,
someone knows why this is happening ? Is Lua able to parse the Chinese language string or this is not a conventional string so the string.sub is not the right thing to do !? Thanks for any input and Happy New Year to everyone :) P.s. We was discussing here: https://www.wowinterface.com/downloa....html#comments |
string library assumes single byte characters, Chinese are multibyte.
You need a library like UTF8 in order to do some of these operations. https://www.curseforge.com/wow/addons/utf8 |
Hi Dridzt,
thanks so much for your reply and suggestion. I imagined it was related to a multibyte problem but didnt know how to solve :) Now I know it could be done with this library. :) But because I am not so sure that the first char I get from a multibyte locale string means what I want I have adopted a mixed approach solution :) For single byte locale string I use the normal string.sub , for multiibyte I prefer to provide (if any) a preset string in localization.lua. Lua Code:
Btw thanks so much for your kind reply. |
All times are GMT -6. The time now is 08:56 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI