Originally Posted by Cirax
Yeah the question here is why your string contains utf8 format instead of plain text.
If it's a must to where you have to use utf8 then you would want to create a table with all the special characters in it with their utf format and then making a replace/convert function to use that table.
|
All strings WoW passes into the Lua environment are encoded in UTF-8. Since UTF-8 was created to be backwards compatible with ANSI, any codes within the ANSI character set will be exactly the same in UTF-8. Also, there's no reason to need a conversion function to store these in Lua. Lua supports full binary in its strings, even embedded zeroes.
Originally Posted by Anja
someone helped me in private message, for those who search for the same answer
i used the wrong regex
%w finds only normal letters
string.match(msg,"(.+)")
finds the rest
|
The result of
(.+) returns the entire contents of the string
msg as it matches all characters. I would recommend using the non-space identifier
(%S+) instead. Note these identifiers are case sensitive in which using the opposite case returns an inverse match. For example, since the lowercase
%s returns any whitespace character, the uppercase
%S would return any non-whitespace character.