Intent not decoding characters


Hi there,

I’m having a weird behaviour using intents with php, i need to post a simple tweet using intents, this is the built url I’m using:" . urlencode("¡Buen día aquí y ahora!") . "&hashtags=hazlorealidad

resulting in this url in the browser url bar:

the intent popup appears and the all the urlencoded chars except whitespaces appear as not decoded, I mean i get this text in the textarea:

%C2%A1Buen d%C3%ADa aqu%C3%AD y ahora%21 #hazlorealidad

the plus signs are decoded into whitespaces but the rest of the chars remain encoded.

I’m getting mad with this, I try all the php function combinations possible, but no success.

Any clue on this issue?

Thanks in advance.



You’re double encoding the text. The correct URL would be¡Buen+día+aquí+y+ahora!&hashtags=hazlorealidad&original_referer=http://worldvision.devlab/


Okie, now trying with this built url, removing the call to the urlencode php function¡Buen+día+aquí+y+ahora!&hashtags=hazlorealidad

if I cut and paste the above url in a browser url bar i get this new transformed url!&hashtags=hazlorealidad

and the next text in the popup textarea:

%22%C2%A1Buen d%C3%ADa aqu%C3%AD y ahora! #hazlorealidad

you are right, there is a double encoding, but don’t know where is made, not in my code, now I’m not making even a single encode, I’m totally lost with this.

Thanks for the quick response.

Regards, Diego.


Probably your templating engine. What happens if you use:

"¡Buen día aquí y ahora!&hashtags=hazlorealidad"


I just encountered this problem while forming the URL in pure Javascript (ie, no templating or server side language involved). For me, the issue is the “www” in front of “”. Try this in the browser:


The redirect to is what is causing the double encoding, so I would pin the blame on Twitter.


The solution from @weschow works for me.

Thanks !


For above encoding issue solution is as below:

<?php $string = "hello who's this"; urlencode(html_entity_decode($string, ENT_COMPAT, 'UTF-8')); ?>

Found this solution here:

Solved my problem.