Questions tagged [percent-encoding]

Percent-encoding (aka URL encoding) is the way that non-alphabet characters are encoded in URLs and URIs (e.g. spaces turn into %20).

See the full Wikipedia article on the subject: Percent-encoding

83 questions
2
votes
3 answers

Why isn't % (percent) considered a reserved character in RFC 3986 (URI Syntax)?

Clearly % needs to be encoded. The wikipedia article on the standard says: Because the percent ("%") character serves as the indicator for percent-encoded octets, it must be percent-encoded as "%25" for that octet to be used as data within a…
John Bachir
  • 22,495
  • 29
  • 154
  • 227
2
votes
1 answer

Arabic UTF Encoding to Percent Encoding in NSURL

am working on some mobile apps that send requests from mobile to internet via Http Requests the problem is that i send Arabic chars in this requests as parameters so i have to convert them from UTF-8 to Percent Encoding i have a java based…
Yahia
  • 691
  • 1
  • 7
  • 24
2
votes
1 answer

URL percent encoding is not working

I'm trying to do a somewhat simple thing with no luck - I want to display Hebrew/Arabic characters in my URL. For example: I want the URL to display a file named: aאm.php So I've percent encoded the middle UTF8 characters and the result is:…
Tom
  • 9,275
  • 25
  • 89
  • 147
2
votes
1 answer

Inconsistencies in URL encoding methods across Objective-C and Swift

I have the following Objective-C code: [@"http://www.google.com" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLPathAllowedCharacterSet]]; // http%3A//www.google.com And yet, in…
Alex Bollbach
  • 4,370
  • 9
  • 32
  • 80
2
votes
6 answers

Turn a hex string into a percent encoded string in Python

I have a string. It looks like s = 'e6b693e6a0abe699ab'. I want to put a percent sign in front of every pair of characters, so percentEncode(s) == '%e6%b6%93%e6%a0%ab%e6%99%ab'. What's a good way of writing percentEncode(s)? (Note, I don't care that…
David Johnstone
  • 24,300
  • 14
  • 68
  • 71
2
votes
1 answer

Wrong NSURLQueryItem percentage encoding for Google CSE

I'm writing app using Google custom search engine. I received my search engine ID XXXXXXXX219143826571:7h9XXXXXXX (most interesting part bold). Now I'm trying to use NSURLQueryItem to embed my ID into URL by using: let params = ["cx" :…
Prettygeek
  • 2,461
  • 3
  • 22
  • 44
2
votes
1 answer

Should I encode names of parameters in a query string of a URI?

I know I need to encode the arguments of parameters in a query string of a URI, but what about the parameter names, do they need to be encoded too?
Trident D'Gao
  • 18,973
  • 19
  • 95
  • 159
2
votes
2 answers

Why does urllib.urlencode append "25" to the result?

The Python code is: user = "aabc" password = "yyy12%" data = urllib.urlencode({"loginname": user, "nloginpwd": password}) print data The result is: loginname=aabc&nloginpwd=yyy12%25 Why was 25 added to the end of the string?
gsky
  • 193
  • 1
  • 10
2
votes
1 answer

NSURLComponents to get percent encoding

According to documentation of NSURLComponents: If you set the unencoded property, you can then obtain the encoded equivalent by reading the encoded property value and vice versa. I tried to get the percent encoding versions of the query and path…
yageek
  • 4,115
  • 3
  • 30
  • 48
2
votes
1 answer

flask url parameters with spaces generates urls with spaces

I'm trying to pass a user supplied string as a Flask URL parameter. url_for(func_name, param="string with spaces") or similar generates a URL with spaces. If the user enter a string with spaces the generated url has spaces it seems to work. Also if…
Roman A. Taycher
  • 18,619
  • 19
  • 86
  • 141
1
vote
2 answers

Is there a quick function to encode/decode strings in Android using full percent encoding?

I want to use percent value encoding/decoding for some string operations in my Android application. I don't want to use a URI encode/decode function pair because I want to encode every character, not just the ones that are encoded when encoding…
Robert Oschler
  • 14,153
  • 18
  • 94
  • 227
1
vote
1 answer

Uri.EscapeDataString behaves different in NUnit test vs. asp.net webservice?

I am using Uri.EncodeDataString to send a query string on a URL. The original string is: Photo($select=Name,Id) In my asp.net web service running in the VS2015 debugger, Uri.EncodeDataString will return: Photo(%24select%3DName%2CId) However, in an…
arch-imp
  • 217
  • 3
  • 12
1
vote
0 answers

Converting foreign characters in URLs

Is there a website converting foreign characters into URL format? I need an instant result after submit foreign character into the request. Examples: 台積電 = %CC%A8%B7e%EB%8A シャープ = %A5%B7%A5%E3%A9%60%A5%D7 혼 하이 =…
Peterlu12
  • 47
  • 7
1
vote
3 answers

Curl request with ntlm authentication fails if password is set

I try to fetch some data from a Microsoft Dynamics Nav WebService. This service uses the NTML authentication. If I open the webservice url in a browser and use the given credentials everything works fine. For setting up the environment for the…
sbonath
  • 11
  • 1
  • 3
1
vote
3 answers

PHP: comparing URIs which differ in percent-encoding

In PHP, I want to compare two relative URLs for equality. The catch: URLs may differ in percent-encoding, e.g. /dir/file+file vs. /dir/file%20file /dir/file(file) vs. /dir/file%28file%29 /dir/file%5bfile vs. /dir/file%5Bfile According to RFC…
Justin Grant
  • 44,807
  • 15
  • 124
  • 208