I've got a friend of mine who has a quote character in his name (Zao'Vien), and I keep adjusting his name in his LMAS files he sends me. This is only a workaround for consumers of his file, since in HIS lmas he'll always be Zao'Vien.
Result of /script d(GetDisplayName())
When I distribute a combined LMAS file and he downloads it, he'll "occur twice" in the tooltip, once incorrectly at the start as current account (but correct for him, as "Zao'Vien") and once correctly(for us, as "Zao'Vien").
Now I know *why* the escaping happens, because pretty much the entire UI is XML, but LMAS takes the account name as-is, so I was wondering if it's possible to do some preprocessing.
I found an article on xml parsing (LuaXml), and since we don't need to parse an entire document, only a small subset of the values (only character data), we could only do the necessary preprocessing, as is seen in XmlParser:FromXmlString:
Code:
Lua Code:
value = string.gsub(value, "&#([0-9]+)%;", function(h) return string.char(tonumber(h,10)) end);
|