View Single Post
Old 09-22-2008, 07:15 PM   #27 (permalink)
Netrix
Purger of Ignorance
zB Programmer
Retired Staff
Expert Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 2,804
Netrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to all
Send a message via MSN to Netrix
Default

Quote:
Originally Posted by itsnotabigtruck View Post
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 = '?';
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter

Solitaire for your Zune! http://www.zuneboards.com/forums/dow...ne-v2-0-a.html

Zune Book Reader! http://www.zuneboards.com/forums/app...ew-thread.html




Netrix is offline   Reply With Quote