Detect charset encoding in Content-Type value for url encode

`url-encode` function uses `UTF-8` encoding by default, so we can't query or post data with other charsets.I tried to fixed this issue.