Browse Source

Fixed invalid cast exception

svn path=/trunk/mcs/; revision=12785
Per Arneng 23 years ago
parent
commit
cc8601c95b
1 changed files with 2 additions and 1 deletions
  1. 2 1
      mcs/class/System.Web/System.Web.Mail/MailUtil.cs

+ 2 - 1
mcs/class/System.Web/System.Web.Mail/MailUtil.cs

@@ -22,7 +22,8 @@ namespace System.Web.Mail {
 	public static bool NeedEncoding( string str ) {
 	    bool needEnc = false;
 	    
-	    foreach( int ch in str ) {
+	    foreach( char chr in str ) {
+		int ch = (int)chr;
 		if( ! ( ( ch > 33 ) && ( ch < 61 ) ) ||
 		    ( ( ch > 61 ) && ( ch < 127 ) ) ) needEnc = true;
 	    }