Thanks man, I can know if a char is in the ASCII range, I can do this: if((int)ch <= 255), and this is sufficient in my case, but I try to find a better way to encode the string like the url format. As Does the HttpServerUtility.UrlEncode method. But I cannot add a reference to the System.web namespace, I have to find some alternative. Thanks for your advice.
HZ