Reprinted from: http://blog.csdn.net/lne818/archive/2008/03/12/2172432.aspx
When URL is used for parameter transfer, some parameters or URL addresses with Chinese names are often passed, and conversion errors may occur during backend processing. In
Private sub commandementclick ()Text2.text = urlencode (text1.text)End sub
Public Function urlencode (byref strurl as string) as stringDim I as longDim tempstr as stringFor I = 1 to Len (strurl)If ASC (mid (strurl, I, 1) Tempstr = "%" & right (CSTR (
For the encoding in the URL, we can use these two functions for processing:
Java.net. urlencoder. encode (STR, "utf8 ");
Java.net. urldecoder. Decode ("% E4 % B8 % 8d % E5 % ad % 95", "UTF-8 ");
These two functions encode and decode the URL
If you have tried to send any information using a GET web request, you wocould have come cross an annoying problem, That annoying problem is making sure that the URL is already ently encoded.
The issue is that by default most of these methods leave
# Pragma once # include # include # include using namespace STD; Class strcoding {public: strcoding (void );~ Strcoding (void); void utf_8togb2312 (string & pout, char * ptext, int Plen); // convert utf_8 to gb2312 void gb2312toutf_8 (string &
# Define SINA_API_AUTHORIZE @ "https://api.weibo.com/oauth2/authorize"
# Define SINA_APP_KEY @ "3456404324"
-(NSURL *) getOauthCodeUrl {// Obtain the auth_code or access_token, which is left for webview
// Https://api.weibo.com/oauth2/authorize
//
// // obtain the weather forecast information based on the city. /// // the Chinese name of a city is as follows: fuzhou //
Public static string getsinawether (string ps_cityname) { string strcity = strconv (ps_cityname, "gb2312 ");
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
Copyright Disclaimer: If you have a reprinted request, please indicate the source:Http://blog.csdn.net/yzhz Yang Zheng
I. Problems:The coding problem is that Java beginners often encounter problems during web development. There are also a large
The first time I used the template smarttemplate, it was much smaller than smarty, but it was inconvenient. Smarty can directly encode the url, such
But it does not seem to have been found in smarttemplate. because the link is submitted by js,
UrlEncode: Refers to the URL of the Web page in the Chinese characters of an encoding conversion, the most common is Baidu, Google and other search engines in the input of English Query time, generated through the Encode page URL.
UrlEncode
Many of the pages with the Jump function (such as the Weibo login page) in the request parameters of the jump address are encoded, and I write the application is not encoded, can also be used. Is it necessary to do URL coding for the jump address?
There are several methods in JavaScript to encode URL strings: escape (), encodeuri (), and encodeuricomponent (). These encodings play different roles.
Escape () method:
The specified string is encoded using the ISO Latin character set. All space
I encountered a problem when I was working on JS encoding, which may be encountered by everyone.
I used the escape () function for encoding, but found that he filtered the plus sign "+.
During decoding, "+" becomes an empty ".
The encodeuri ()
Escape () method:The specified string is encoded using the ISO Latin character set. All space characters, punctuation marks, special characters, and other non-ASCII characters will be converted into character encoding in % xx format (xx equals to
The first time I used the template smarttemplate, it was much smaller than smarty, but it was inconvenient.
The first time I used the template smarttemplate, it was much smaller than smarty, but it was inconvenient.
Smarty can directly encode
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.