Call a download program today. When the downloaded URL contains Chinese characters, it cannot be downloaded, for example:
Http://www.huachu.com.cn/itbook/booklist.asp? Tsmc = assembly
I will use the Server. UrlEncode function in. net for conversion.
Httputility. urlencode method:
Encode the URL string to implement reliable HTTP transmission from the Web server to the client.
Reload listConverts byte arrays to encoded URL strings for reliable HTTP transmission from the Web server to the
Notes:1. httputility. urlencode and httputility. urldecode are static methods, while server. urlencode and server. urldecode are instance methods.2. Server is an instance of the httpserverutility class and a property of system. Web. UI. Page.3.
Parameters on the latest website include Chinese characters, for example:
Http://www.chinapoesy.com/Tag%b0% AE %c7%e9.html
Server. urlencode has already been used. However, some Chinese characters cannot be found in URL rewriting, so there is no
Today, a friend sent a message to ask about the urlencode encoding result of another person, which is different from his own. The situation is as follows:
The result returned by someone else's server. urlencode ("Sony") is % CB % F7 % c4 % E1
Parameters on the latest website include Chinese characters, for example:
Http://www.chinapoesy.com/Tag%b0% AE %c7%e9.html
Server. urlencode has already been used. However, some Chinese characters cannot be found in URL rewriting, so there is no
Server. urlencode MethodThe URL encoding rules will be applied to a string, including escape characters.
Urlencode converts the following characters:
Space () is converted to the plus sign (+)
Non-alphanumeric characters are converted to their
The following is reproduced from:
Http://hi.baidu.com/yisqiu/blog/item/e0804bfb9243fb67024f5624.html
Which one should I use for URL encoding? Are there any differences between these two methods?Test:String file = "file (upload document .doc
The same server. urlencode has different encoded characters on different pages. Later, I checked the original characters ..
Which one should I use for URL encoding? Are there any differences between these two methods?Test:String file = "file
I was told today that a page is garbled. As a result, the Chinese characters are passed in through URL parameters. server. urlencode () encoding is used before the input. It seems that there is no problem.
A little strange. When a breakpoint is set,
SQL Server UrlEncodeif exists (SELECT * from dbo.sysobjects WHERE id = object_id (N ' [dbo].[ UrlEncode] ') and xtype in (n ' FN ', n ' IF ', n ' TF ')--delete the function drop functions [dbo]. [UrlEncode] Gocreate FUNCTION dbo. UrlEncode (@URL
In the json processing of asp tutorial. net, single quotes or other special characters are often used. If you use them directly, json data is truncated, causing js errors to fail to run correctly.
In fact, you only need to use the escape method of
Chaotic URI Encoding
There are three methods for encoding in javascript: escape, encodeuri, encodeuricomponent
C # encoding methods: httputility. urlencode, server. urlencode, Uri. escapeuristring, Uri. escapedatastring
The javascript code is okay.
C # Use System. Web. httputility. urlencode instead of server. urlencode to pass Chinese parameters in Asp.net URL.
Parameters on the latest website include Chinese characters, for example:
Http://www.chinapoesy.com/Tag%b0% AE %c7%e9.html
Server.
ASP. NET In
URL Encoding Decoding
Today, the project needs to post data to the ASP Client URL, but the URL Chinese cannot be used. In the afternoon, ASP andAsp.netOfURL EncodingDifferent things:
Let's take a look at the following two URLs. Are
Recently, the last project is actually very simple, that is, splicing a URL. However, the URL parameters require urlencode encoding. For me, this problem is well solved. C # uses httputility. urlencode. asp uses server. urlencode.
Is the problem
The C # decoding function System corresponding to escape in js. web. httpUtility. urlDecode (s). Pay attention to the C # decoding function System corresponding to escape in js as follows. web. httpUtility. urlDecode (s) // pay attention to Encoding
In ASP. NET, the request cannot obtain the correct Chinese parameter. For example, the Chinese value obtained from dropdownlist is incorrect. Why? How can this problem be solved ??
Server. urlencode (dropdownlist1.selecteditem. Text)
Add the
Use ASP. NET to encrypt cookie dataTang Jinhua
2003-1-21 13:34:54
Cookies provide convenience for both visitors and programmers in Web applications. However, there are security
There are generally three solutions:
1. Set the web. config file
............
2. Before passing Chinese characters, encode the Chinese parameters to be passed and decode them upon receiving them.> Transfer
String Name = "Chinese parameter ";Response.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.