Little bit of rant.... I use UTF-8 in files and in memory. I convert to UTF-16 and UTF-32 at runtime as needed to interact with other interfaces. I have found this solution works well. Microsoft is one of the few companies that uses UTF-16 and I suppose in a typical MS fasion, they thought 35k glyphs is enough for anyone. Well it isn't and now we have UTF-16 with surrogates to try and get around the problem. UTF-8 is elligant because you can quickly and stabaly work with 1-3 byte characters and the strings are single byte zero terminated making them compatible with classic string functions and ASCII.
When I use localized text in game, my script looks like this:
Code:
SomeDisplay( LangText("#str_health", player.health) );
Where #str_health is a Key to look up localized string "Health %d" or such.
LangText() is a script function that looks up that localized string and applies formatting.
Code:
global LangText = function(a_langString, a_param1, a_param2, a_param3, a_param4, a_param5, a_param6, a_param7, a_param8)
{
return format( LoadLanguageString(a_langString), a_param1, a_param2, a_param3, a_param4, a_param5, a_param6, a_param7, a_param8);
};
LoadLanguageString() is a native binding that returns a string from a specified Key.
I believe GM strings can contain UTF-8 characters, but outside of that it doesn't handle unicode.