Originally Posted by Phanx
This is incorrect. At least on EU realms, apostrophes are included in the realm names as passed with CHAT_MSG_* events and returned by UnitFullName.
I couldn't find anyone with a non-ASCII character, and didn't feel like going and making a character on a FR/IT/PT realm to check, but I suspect they are also used as-is in-game.
|
I specifically noted the apostrophe part and unicode normalization as an aside relevant to the armory, not in-game.
You can safely ignore my edit and use the first part of the post that's relevant to the question and apparently provides a suitable method.
Edit: I also (with regard to armory) wasn't referring to the player name but the realm name.
As an example
this is what happens to the url for "Pozzo dell'Eternità" (an Italian realm)