Quote:
Originally Posted by itsnotabigtruck
I'll just post it right here.
Code:
string FilterText(string str)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < str.Length; ++i)
sb.Append((str[i] >= 32 && str[i] <= 126) ? str[i] : '?');
return sb.ToString();
}
Change the range of characters it checks for if you are using CharacterRegions other than the default. You need to run that function on any text that might contain accented characters (that namely includes names of stuff from the user's music library) before passing it to DrawString.
|
Why not just use this?
Code:
SpriteFont.DefaultCharacter = '?';