Questions tagged [urlencode]

To “URL encode” or “percent encode” text means to encode it for use in a URL. Some characters are not valid when used as-is in URLs, and so much be URL-encoded (percent-encoded) when appearing in URLs.

https://url.spec.whatwg.org/#percent-encoded-bytes is the section of the current URL standard that defines percent encoding (URL encoding).

2314 questions
31
votes
6 answers

How can I "URL decode" a string in Emacs Lisp?

I've got a string like "foo%20bar" and I want "foo bar" out of it. I know there's got to be a built-in function to decode a URL-encoded string (query string) in Emacs Lisp, but for the life of me I can't find it today, either in my lisp/ folder or…
Ken
  • 5,074
  • 6
  • 30
  • 26
30
votes
7 answers

.net UrlEncode - lowercase problem

I'm working on a data transfer for a gateway which requires me to send data in UrlEncoded form. However, .net's UrlEncode creates lowercase tags, and it breaks the transfer (Java creates uppercase). Any thoughts how can I force .net to do uppercase…
balint
  • 3,391
  • 7
  • 41
  • 50
30
votes
3 answers

Url encoding quotes and spaces

I have some query text that is being encoded with JavaScript, but I've encountered a use case where I might have to encode the same text on the server side, and the encoding that's happening is not the same. I need it to be the same. Here's an…
Samo
  • 8,202
  • 13
  • 58
  • 95
30
votes
2 answers

Should I url encode a query string parameter that's a URL?

Just say I have the following url that has a query string parameter that's an url: http://www.someSite.com?next=http://www.anotherSite.com?test=1&test=2 Should I url encode the next parameter? If I do, who's responsible for decoding it - the web…
Brad Parks
  • 66,836
  • 64
  • 257
  • 336
30
votes
2 answers

Do colons require encoding in URI query parameters?

I've noticed that Java's UriBuilder isn't encoding the : characters included in my query parameter values (ISO 8601-formatted strings). According to Wikipedia, it seems colon should be encoded. In particular, encoding the query string uses the…
HolySamosa
  • 9,011
  • 14
  • 69
  • 102
29
votes
4 answers

Error with urlencode in python

I have this: a = {'album': u'Metamorphine', 'group': 'monoku', 'name': u'Son Of Venus (Danny\xb4s Song)', 'artist': u'Leandra', 'checksum': '2836e33d42baf947e8c8adef48921f2f76fcb37eea9c50b0b59d7651', 'track_number': 8, 'year': '2008', 'genre':…
diegueus9
  • 29,351
  • 16
  • 62
  • 74
28
votes
2 answers

Portable Class Library HttpUtility.UrlEncode

I understand that making web requests is quite well supported in the Portable Class Library. Is there any equivelant of HttpUtility.UrlEncode in the PCL? I need it for Windows Phone and Metro applications.
28
votes
5 answers

php javascript url encoding

I have a html text. I had encoded it in php using urlencode function. I want to decode that text in the javascript. when i use unescape function in javascript it replaces all the special characters back but sapce is replaced by '+'. how can i do it…
Andromeda
  • 12,659
  • 20
  • 77
  • 103
26
votes
1 answer

Is URL percent-encoding case sensitive?

Is %3B treated differently to %3b in an URL?
hugomg
  • 68,213
  • 24
  • 160
  • 246
26
votes
8 answers

JavaScript Array to URLencoded

is there any js function to convert an array to urlencoded? i'm totally newbie n JS... thanks!... my array is a key & value array.... so, myData=new Array('id'=>'354313','fname'=>'Henry','lname'=>'Ford'); is the same…
theHack
  • 1,938
  • 9
  • 26
  • 33
25
votes
4 answers

URL Encode string for Href ASP.NET MVC / Razor

I'm trying to build an Href using Razor The string is going to end up looking like…
Chris Nevill
  • 5,922
  • 11
  • 44
  • 79
24
votes
4 answers

Why doesn't decodeURI("a+b") == "a b"?

I'm trying to encode URLs in Ruby and decode them with Javascript. However, the plus character is giving me weird behavior. In Ruby: [Dev]> CGI.escape "a b" => "a+b" [Dev]> CGI.unescape "a+b" => "a b" So far so good. But what about Javascript? >>>…
Tom Lehman
  • 85,973
  • 71
  • 200
  • 272
24
votes
2 answers

How to create a custom NSCharacterSet?

I’m using CharacterSet.urlQueryAllowed to add percent-encoding to a String. Some characters are not encoded the way I expected (i.e. & and ? are not changed). That being said, I had the idea to build a custom CharacterSet, ideally based on an…
ixany
  • 5,433
  • 9
  • 41
  • 65
24
votes
2 answers

How to decode the url in php where url is encoded with encodeURIComponent()

How to decode the url in php where url is encoded with encodeURIComponent()? I have tried the urldecode() but then also..i don't the url which i have encoded... I have to do this in php..
Nitz
  • 1,690
  • 11
  • 36
  • 56
24
votes
4 answers

Why is System.Web.HttpUtility.UrlEncode giving namespace name doesn't exist in Visual C# 2008?

I'm trying to encode a URL using the HttpUtility.UrlEncode() method, why am I getting The type or namespace name 'HttpUtility' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) error ? I'm using Visual C# 2008,…
Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134