![]() Internally, UrlEncode uses the UrlEncode method to encode strings. UrlEncode is a convenient way to access the UrlEncode method at run time from an ASP.NET application. Therefore, using the UrlEncode method provides the same results as using the UrlEncode method and specifying UTF8 as the second parameter. The HttpUtility.UrlEncode method uses UTF-8 encoding by default. Use the UrlPathEncode method when you encode the path portion of a URL in order to guarantee a consistent decoded URL, regardless of which platform or browser performs the decoding. The UrlPathEncode method converts each space character into the string "%20", which represents a space in hexadecimal notation. The UrlEncode method converts each space character to a plus character (+). However, the methods return different results. You can encode a URL using with the UrlEncode method or the UrlPathEncode method. For example, when the characters are embedded in a block of text to be transmitted in a URL, they are encoded as %3c and %3e. URL encoding converts characters that are not allowed in a URL into character-entity equivalents URL decoding reverses the encoding. If characters such as blanks and punctuation are passed in an HTTP stream without encoding, they might be misinterpreted at the receiving end. The UrlEncode(String) method can be used to encode the entire URL, including query-string values.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |