All of the very few peeps to use my addon are based in Europe. And being "Johnny Foreigners" they will insist on using "funny" letters (ÐãØë?). The problem is, not everyone can easily type all of them. So most of the time they use the non-accented version (DaOeC). This, ofc, makes string matching impossible.
The only solution I can think of, is some sort of look up table. But I can't help thinking there's a more cleaver way of solving it. Would anyone have any alternative suggestions or ideas?
Edit: Sorry, I forgot to make it clear that my tongue is firmly in cheek for the first part. :)
In a word, yes. My guild uses a website calendar to arrange raids. Attending Toon names are listed on the site. Using my addon, the raid leader can copy+paste the list of names into my addon, which will then send out group invites to those toons.
What I want to do create a function so I can reuse it anywhere:
if RemoveAccents (Var1) == RemoveAccents (Var2) then
...
end
The way I did it was to read it in through a lua addon file which is in utf-8 format which is generated by a custom php script. In your case this could be exported from the website calendar you already are using. Then you can control the format instead of the user. If I am understanding what you want correctly.
The simplest solution would be to tell people to stop being lazy and type the character name they chose if they want a raid invite. If their regional keyboard layout makes it so difficult to type è or whatever, they should have thought of that before using it in their character name, or they should memorize the Alt+#### shortcut for typing it in their OS.
If the raid leader himself is typing the list on the website, why not just modify your website to provide a list of all the characters in the guild (pulled from the Armory or something) and then just let the raid leader check off the ones to invite?
As far as an in-game Lua solution goes, a lookup table mapping å to a and so on is basically your only option. Also, if someone named their main "Ímånìdîõt" and their alt "Îmâñïðíòt", there would be no way for the addon to tell which one should match the lazily typed string "Imanidiot".
hehe. While I would agree with your sentiment if we were talking about native English speakers - the problem is, we're not. This is Europe, native English speakers are very much the minority.
For most of my guild members, accented letters are a part of every day life. So I must respect and accommodate these linguistic differences. And it doesn't help that different European languages use different accented letters. So not all players can type every variation.
My addon provides an edit box for the text entry. If I find duplicate names, I can update that text and ask the user to edit. Everyone can delete. :)
Well, based on your description it sounded like you had a setup where the players themselves were typing the name of the character they wanted to bring to the raid on a forum, and the raid leader was then copying those names from the forum and pasting them in-game. Presumably a player should know how to type any accented letters in thier character's name.
If the names are being typed by the raid leader, you could add a "virtual keyboard" next to the text entry field with buttons to click to add accented letters at the current cursor position. Such a system should work equally well using Lua in your addon, and JavaScript on your forum if you wanted to duplicate it there.
If the names are being typed by the raid leader, though, it seems like there are a number of methods you could use that would be easier and less prone to user error. For example, your addon could list all of the level-85 characters in your guild and split them up by class. The raid leader could then simply check off all of the DKs he wanted to invite, all of the druids, all of the hunters, etc. and the addon could generate a list with all of the correct letters. If the list needed to be posted on a forum as well, the addon could populate a text entry field with the list, so the raid leader could copy it from in-game and paste it on the forum.
Well, based on your description it sounded like you had a setup where the players themselves were typing the name of the character they wanted to bring to the raid on a forum, and the raid leader was then copying those names from the forum and pasting them in-game. Presumably a player should know how to type any accented letters in thier character's name.
Nope, Players point and click to sign up to an event. The event administrator, then selects the players and the toon they will play and their role. This is the list that gets typed. The event administrator is not always the person leading the raid.
If the names are being typed by the raid leader, you could add a "virtual keyboard" next to the text entry field with buttons to click to add accented letters at the current cursor position. Such a system should work equally well using Lua in your addon, and JavaScript on your forum if you wanted to duplicate it there.
I like the idea of a point and click solution for the website, but I don't have the knowledge or the access to implement such a change.
If the names are being typed by the raid leader, though, it seems like there are a number of methods you could use that would be easier and less prone to user error. For example, your addon could list all of the level-85 characters in your guild and split them up by class. The raid leader could then simply check off all of the DKs he wanted to invite, all of the druids, all of the hunters, etc. and the addon could generate a list with all of the correct letters. If the list needed to be posted on a forum as well, the addon could populate a text entry field with the list, so the raid leader could copy it from in-game and paste it on the forum.
I'm not convinced of the benefits for your in game solution. Unless the user could remember all attendees, they would still need to alt-tab between game and browser. So it would have to be a particularly fancy window for the user to think it's better than using the existing guild roster window to send invites manually.
I'm a "new" member in a well established guild. I don't want to bore peeps with details of our administration procedures, which I can't change. So I need to make my addon look simple, flexible and be able to fit into established routines.
If you fancy being horrified, the latest version of my addon can be found here. I have coded for "Imanidiot" type duplicates, but there aren't any in my guild, so I've not properly tested or implemented that feature.
If this is only related to guildmembers then you could also use the guild roster to make a system where you find the best match from the playernames found in the roster.
Again you would need lookuptable to translate æ to ae, ø to o and å to a and so on.
I know that for ASCII we can use bit-flipping to more efficiently change between uppercase/lowercase at assembly level, but in WoW we are using unicode and we are also restricted to what LUA provides us with.
Edit:
Ah, i seem to have found what i was thinking of.
This could make it possible to change from è to e and so on into a simple function instead of having to rely on a hardcoded lookup table.
Tip: If you got any problems with the unicode not converting properly, then try saving your .lua file in UTF8 encoded with a BOM signature. Most text editors, even (windows notepad) got an option to do this.
I dont know how WOW and LUA and handles this, but past experience from other languages tells me that the LUA parser at startup will use unicode if you save the file in utf8 and ascii/ansi if save the file as that and so on.
Thanks for the information. I've learned something new about my text editor and UTF8. :) I was saving files as ansi.
I've not had much time to look in detail, but I seem to remember a bit about string.char not being OS independent. As WoW runs on Windows and Mac, I'd want to test how Blizzard's code handles this.
Also, Blizzard's code seems to be inconsistent in the way string.xxx functions handle UTF8. Sometimes an accented letter magically become 2 chars when using certain functions. Hence the TitleCase function, I nicked from elsewhere.
Ofc, this all could be down to gaps in my knowledge, so when I have time - I shall keep looking.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
All of the very few peeps to use my addon are based in Europe. And being "Johnny Foreigners" they will insist on using "funny" letters (ÐãØë?). The problem is, not everyone can easily type all of them. So most of the time they use the non-accented version (DaOeC). This, ofc, makes string matching impossible.
The only solution I can think of, is some sort of look up table. But I can't help thinking there's a more cleaver way of solving it. Would anyone have any alternative suggestions or ideas?
Edit: Sorry, I forgot to make it clear that my tongue is firmly in cheek for the first part. :)
What I want to do create a function so I can reuse it anywhere:
If the raid leader himself is typing the list on the website, why not just modify your website to provide a list of all the characters in the guild (pulled from the Armory or something) and then just let the raid leader check off the ones to invite?
As far as an in-game Lua solution goes, a lookup table mapping å to a and so on is basically your only option. Also, if someone named their main "Ímånìdîõt" and their alt "Îmâñïðíòt", there would be no way for the addon to tell which one should match the lazily typed string "Imanidiot".
hehe. While I would agree with your sentiment if we were talking about native English speakers - the problem is, we're not. This is Europe, native English speakers are very much the minority.
For most of my guild members, accented letters are a part of every day life. So I must respect and accommodate these linguistic differences. And it doesn't help that different European languages use different accented letters. So not all players can type every variation.
My addon provides an edit box for the text entry. If I find duplicate names, I can update that text and ask the user to edit. Everyone can delete. :)
Thank you for your replies.
If the names are being typed by the raid leader, you could add a "virtual keyboard" next to the text entry field with buttons to click to add accented letters at the current cursor position. Such a system should work equally well using Lua in your addon, and JavaScript on your forum if you wanted to duplicate it there.
If the names are being typed by the raid leader, though, it seems like there are a number of methods you could use that would be easier and less prone to user error. For example, your addon could list all of the level-85 characters in your guild and split them up by class. The raid leader could then simply check off all of the DKs he wanted to invite, all of the druids, all of the hunters, etc. and the addon could generate a list with all of the correct letters. If the list needed to be posted on a forum as well, the addon could populate a text entry field with the list, so the raid leader could copy it from in-game and paste it on the forum.
Nope, Players point and click to sign up to an event. The event administrator, then selects the players and the toon they will play and their role. This is the list that gets typed. The event administrator is not always the person leading the raid.
I like the idea of a point and click solution for the website, but I don't have the knowledge or the access to implement such a change.
I'm not convinced of the benefits for your in game solution. Unless the user could remember all attendees, they would still need to alt-tab between game and browser. So it would have to be a particularly fancy window for the user to think it's better than using the existing guild roster window to send invites manually.
I'm a "new" member in a well established guild. I don't want to bore peeps with details of our administration procedures, which I can't change. So I need to make my addon look simple, flexible and be able to fit into established routines.
If you fancy being horrified, the latest version of my addon can be found here. I have coded for "Imanidiot" type duplicates, but there aren't any in my guild, so I've not properly tested or implemented that feature.
Again you would need lookuptable to translate æ to ae, ø to o and å to a and so on.
I know that for ASCII we can use bit-flipping to more efficiently change between uppercase/lowercase at assembly level, but in WoW we are using unicode and we are also restricted to what LUA provides us with.
Edit:
Ah, i seem to have found what i was thinking of.
This could make it possible to change from è to e and so on into a simple function instead of having to rely on a hardcoded lookup table.
http://ahinea.com/en/tech/accented-translate.html
It might be doable in LUA using string.char() and string.byte() for the conversion.
Although if those functions are supported in WoW i dont know.
Souce: http://lua-users.org/wiki/StringLibraryTutorial
Tip: If you got any problems with the unicode not converting properly, then try saving your .lua file in UTF8 encoded with a BOM signature. Most text editors, even (windows notepad) got an option to do this.
I dont know how WOW and LUA and handles this, but past experience from other languages tells me that the LUA parser at startup will use unicode if you save the file in utf8 and ascii/ansi if save the file as that and so on.
I've not had much time to look in detail, but I seem to remember a bit about string.char not being OS independent. As WoW runs on Windows and Mac, I'd want to test how Blizzard's code handles this.
Also, Blizzard's code seems to be inconsistent in the way string.xxx functions handle UTF8. Sometimes an accented letter magically become 2 chars when using certain functions. Hence the TitleCase function, I nicked from elsewhere.
Ofc, this all could be down to gaps in my knowledge, so when I have time - I shall keep looking.