Why is the comma URL encoded?

The URI spec, RFC 3986, specifies that URI path components not contain unencoded reserved characters and comma is one of the reserved characters. For sub-delims such as the comma, leaving it unencoded risks the character being treated as separator syntax in the URI scheme. Percent-encoding it guarantees the character will be passed through as data.

urllib.quote() throws KeyError

You are trying to quote Unicode data, so you need to decide how to turn that into URL-safe bytes. Encode the string to bytes first. UTF-8 is often used: >>> import urllib >>> urllib.quote(u’sch\xe9nefeld’) /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py:1268: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode – interpreting them as being unequal return ”.join(map(quoter, s)) … Read more

How to encode the plus (+) symbol in a URL

The + character has a special meaning in [the query segment of] a URL => it means whitespace: . If you want to use the literal + sign there, you need to URL encode it to %2b: body=Hi+there%2bHello+there Here’s an example of how you could properly generate URLs in .NET: var uriBuilder = new UriBuilder(“https://mail.google.com/mail”); … Read more

facebook error ‘Error validating verification code’

There are presently (as of March 2011) undocumented requirements regarding what makes a valid redirect_uri. First, both redirect_uri paramaters to authorize and access_token must match. Apparently Facebook (or rather OAuth2) is using the redirect_uri as a internal key to encode the code returned for the access_token request. It’s kinda clever since it verifies back to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)