If I use UnitName('target') on a person that has a foreign name like russian or something, it returns back as "?????" but blizzards own UI doesn't have that issue. What do I need to do to make this work?
The default UI can display the characters. So why can't my addon do it?
Default UI uses lua just the same as addons do. I looked at the code that gets the servername and playername I see nothing special there.
So how do I add fonts to my addon?
And I would need to add all since it can cover all languages blizzard has wow in.
Also using format for strings, so need to know if I have to do anything special there to support names in all languages.
For additional fonts, take a look at LibSharedMedia-3.0. This library allows you to select a font amongst several ones. Some of them are shipped with the game client so they are always available. The library provides a list of available fonts, automatically listing russian and asian fonts whenever they are available. With AceGUI-3.0-SharedMediaWidgets, you can easily add a nice font selection widget to your AceConfig panels.
For string formating, nothing more is necessary.
If you plan to use pattern matching (strmatch, string.match, string.find, string.gsub, ...), be aware the following character classes only known "pure" ASCII letters : %a (all letters), %l (lowercase letters), %u (uppercase letters) and %w (alphanumeric characters).
Ok I fixed it. I switched to arial narrow. Guess I'll have to go thru all the fonts and find one that supports unicode and make that the default.
I don't think there's any font in the world that "supports Unicode" as a whole. Most fonts cover only the most widely-used character sets, and others specialize in the character sets needed for a particular language and may not even include glyphs for basic Latin characters.
If you want to use one of the default game fonts, just ask the game client which font file it's using for the user's current locale:
-- Gets the local equivalent of Fonts\\FRIZQT__.ttf:
local font = GameFontNormal:GetFont()
-- Gets the local equivalent of Fonts\\ARIALN.ttf:
local font = ChatFontNormal:GetFont()