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).

2072 questions
87
votes
19 answers

Encode/Decode URLs in C++

Does anyone know of any good C++ code that does this?
user126593
  • 2,357
  • 2
  • 19
  • 16
83
votes
5 answers

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

The URL link below will open a new Google mail window. The problem I have is that Google replaces all the plus (+) signs in the email body with blank space. It looks like it only happens with the + sign. How can I remedy this? (I am working on a…
user523234
  • 12,877
  • 8
  • 55
  • 98
77
votes
15 answers

How can I URL encode a string in Excel VBA?

Is there a built-in way to URL encode a string in Excel VBA or do I need to hand roll this functionality?
Matthew Murdoch
  • 28,946
  • 26
  • 89
  • 125
77
votes
10 answers

How do I replace all the spaces with %20 in C#?

I want to make a string into a URL using C#. There must be something in the .NET framework that should help, right?
Haim Bender
  • 7,243
  • 8
  • 48
  • 54
76
votes
5 answers

How to generate url encoded anchor links with AngularJS?

{{address}} generates links that are not url encoded if I understand correctly. What is the proper way to encode #/search?query={{address}}? Example address is 1260 6th…
randomguy
  • 11,352
  • 14
  • 65
  • 94
75
votes
3 answers

How to URL encode in Python 3?

I have tried to follow the documentation but was not able to use urlparse.parse.quote_plus() in Python 3: from urllib.parse import urlparse params = urlparse.parse.quote_plus({'username': 'administrator', 'password': 'xyz'}) I get AttributeError:…
amphibient
  • 25,192
  • 44
  • 130
  • 215
71
votes
10 answers

http_build_query() without url encoding

Is there a way to use http_build_query() without having it URL encode according to some RFC standard? Why I don't want to URL encode everything: I'm querying the Ebay API.. They honestly insist on parameter names not being URL encoded, as far as…
bgcode
  • 24,347
  • 30
  • 92
  • 158
71
votes
1 answer

How to encode URL in Groovy?

Is there a kind of URLEncode in Groovy? I can't find any String → String URL encoding utility. Example: dehydrogenase (NADP+) → dehydrogenase%20(NADP%2b) (+ instead of %20 would also be acceptable, as some implementations do that)
Nicolas Raoul
  • 55,003
  • 52
  • 197
  • 338
70
votes
7 answers

Why should I use urlencode?

I am writing a web application and learning how to urlencode html links... All the urlencode questions here (see tag below) are "How to...?" questions. My question is not "How?" but "Why?". Even the wikipedia article only addresses the mechanics…
augustin
  • 13,003
  • 11
  • 55
  • 77
58
votes
10 answers

URL-encoded slash in URL

My Map is: routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with params new { controller = "Home", action = "Index", id = "" } // Param…
Mathias F
  • 14,815
  • 19
  • 82
  • 151
57
votes
7 answers

How do I encode URI parameter values?

I want to send a URI as the value of a query/matrix parameter. Before I can append it to an existing URI, I need to encode it according to RFC 2396. For example, given the input: http://google.com/resource?key=value1 & value2 I expect the…
Gili
  • 76,473
  • 85
  • 341
  • 624
54
votes
12 answers

facebook error 'Error validating verification code'

very strange error. i use gide http://developers.facebook.com/docs/authentication/. so i create request to fb and pass redirect_uri. i use test site on localhost. so if i pass redirect_uri=http://localhost/test_blog/index.php it works fine, but…
kusanagi
  • 13,070
  • 19
  • 78
  • 106
49
votes
8 answers

urllib.urlencode doesn't like unicode values: how about this workaround?

If I have an object like: d = {'a':1, 'en': 'hello'} ...then I can pass it to urllib.urlencode, no problem: percent_escaped = urlencode(d) print percent_escaped But if I try to pass an object with a value of type unicode, game over: d2 = {'a':1,…
user18015
47
votes
5 answers

urlencoding in Dart

Is there a function to do urlencoding in Dart? I am doing a AJAX call using XMLHttpRequest object and I need the url to be url encoded. I did a search on dartlang.org, but it didn't turn up any results.
Sudar
  • 16,394
  • 28
  • 76
  • 123
45
votes
4 answers

cannot urllib.urlencode a URL in python

Why am I getting this error when trying to urlencode this string >>> callback = "http://localhost/application/authtwitter?twitterCallback" >>> urllib.urlencode(callback) Traceback (most recent call last): File "", line 1, in…
BillPull
  • 8,335
  • 15
  • 54
  • 93