Add utility methods to handle illegal chars

Add utility methods to handle invalid chars according to list at http://support.microsoft.com/kb/905231