Escape () method:
The specified string is encoded using the ISO Latin character set. All spaces, punctuation, special characters, and other non-ASCII characters will be converted into%XX-formatted character encodings (XX equals the encoded 16 digits
When I was doing JS code, I ran into a problem, maybe everyone has encountered.
I used the escape () function to encode, but found that he was the plus "+" filter.
At the time of decoding "+" has become empty "".
The test encodeURI () function
We in the entry code, wrote some examples, it seems like this class, only the content, open Javadoc and then look, found that the bag is really a lot of goods.Commons Codec 1.4 API
Packages
Org.apache.commons.codec
A
Program IntroductionThe Super SQL Injection tool (ssqlinjection) is an HTTP protocol-based self-package SQL injection tool that supports SQL injection anywhere in the HTTP protocol, supports various types of SQL injection, and supports HTTPS mode
In the previous article: [iOS] How to Use JS to call iOS functions in WebApp, I mentioned how to use JS to call iOS Internal functions by modifying the URL.
One problem is the encoding problem. For example, if a pop-up window is called via URL,
Solution: Use js to encode the Chinese characters in the URL.
Copy codeThe Code is as follows:The following figure shows the validity of the link:
Reference: http: // 127.0.0.1/shop/product_list.php? P_sort = PHP % u5F00 % u53D1 % u8D44 % u6E90 %
Xu zening's php version of the escape/unescape FunctionCopy codeThe Code is as follows:Function escape ($ str ){Preg_match_all ("/[\ x80-\ xff]. | [\ x01-\ x7f] +/", $ str, $ r );$ Ar = $ r [0];Foreach ($ ar as $ k => $ v ){If (ord ($ v [0]) $ Ar [$
URLEncode: a pointer to the Chinese characters in the url of a Web page. The most common method is to enter Chinese Characters in search engines such as Baidu and Google, generate a webpage URL that has passed the Encode.
URLEncode: a pointer to the
The following is a detailed explanation :///\\\String urlencode (string str)Returns a string -_. all other non-alphanumeric characters will be replaced with a semicolon (%) followed by two hexadecimal numbers, and spaces will be encoded as the plus
When url is used for parameter transfer, some parameters or URL addresses with Chinese names are often passed.
When url is used for parameter transfer, some parameters or URL addresses with Chinese names are often passed, and conversion errors may
in PHP UrlEncode () function is to convert the Chinese into a string encoding, so that does not cause the Chinese URL in the browser open garbled or error problems, let me introduce you in the use of UrlEncode () coding is some specific
Smarty can encode URLs directly, such as
But in the smarttemplate as if there is no, because the link is submitted by JS, not the form submission, so it cannot be automatically encoded.
Workaround: Use JS to the URL of the Chinese character escape
In js, if we want to encode the url, the commonly used functions include escape, encodeURI, and encodeURIComponent. The corresponding three decoding functions are: unscape, decodeURI, and decodeURIComponent, next we will introduce the conversion
Problems to be Solved:Upload the following URL as a parameter to other pages1 http: // domain/de. retrial? Uid = 12 & page = 152. The parameters following the url contain Chinese characters, such as:... aspx? Title = craneIn the above case, an RUL
Function gbtoutf8 (szinput)Dim wch, uch, szretDim XDim NASC, nasc2, nasc3
'Exit the function if the input parameter is null.If szinput = "" thenGbtoutf8 = szinputExit FunctionEnd if
'Start ConversionFor x = 1 to Len (szinput)Wch = mid (szinput, X,
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.