special letters
Code:
dkp = { dkp.playername doenst work with special letters, can i first convert the playername string to this \170\162 Stuff? to get the right array key? something like... Code:
s = Frêemân |
dkp.blabla is the same as dkp["blabla"].
For a string value, use (e.g.) local s = "blabla" local val = dkp[s] |
but when the string value is with special character like é or â then i didnt find the array key because of this \015\102 in it, how can i convert the á into \016 ?! to match the key in the array?!
|
If we're talking about an in-game addon (.lua) then making sure you save your file as utf8 should suffice for saving and looking up keys without escaping characters.
That is save as [blâblâ] and look it up the same way. If you have a web interface parsing saved variables, or you need to copy paste from in-game to a web site or some other interaction of the kind, provide more information about what exactly you're trying to accomplish and in what environment :) |
Yeah the question here is why your string contains utf8 format instead of plain text. As Driz asked, are you using an external dkp extracting addon or something?
Saving as... Code:
dkp = { Code:
dkp["Frêemân"] |
yepp the data format ist only like
["B\195\162be"] or ["Dw\195\161yna"] = { ["DKP"] = 100.00 } the data comes from http://absence-gilde.com/eqdkp/getdkp.php eqdkp the old addon "GetDKP" doesnt work, so i codet my own little "whisper to get dkp" addon. it works fine, (with my very bad code *g*) but the utf8 problem let it only work for normal character names. Code:
SLASH_DKP1 = "/dkp" |
Lua Code:
|
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 ;) |
Quote:
Quote:
|
Lua Code:
works, but the code is little messie ^^ just because of the "ChatFrame5" thing, i didnt know how to prevent the double posts because of same whispers in more tabs :( sry for my problems here, i'm just learning lua at the moment ^^ |
I would actually recommend moving your whisper reply code into its own frame and handler. The problem with putting it in with the rest of your filter functions is those functions run for every ChatFrame that has the whisper event registered.
Another problem is if no ChatFrames are registered with the whisper event, the filter functions will never run. |
All times are GMT -6. The time now is 04:00 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI