URL Encoding Percentage Space

1.1k Views Asked by At

Twitter sharing link problem with URL Encoding. i need to share this sentence.

i am giving you 40% discount

i am trying this to pass from url

i+am+giving+you+40%+discount  

but its not working because +40%+ become %2040%%20

Two percentage %% together create problem
What will be solution?

1

There are 1 best solutions below

1
On

Use encoded "%" -> "%25", also maybe you try some library for URL encoding. Your url will looks like "i%20am%20giving%20you%2040%25%20discount"

  • %20 - is a space
  • %25 - % symbol