Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

in my Android app I use this method:

URLDecoder.decode(this.name,"UTF-8")

It decodes the name sent from my server side, where, in PHP, I use:

urlencode($name);

Apparently, this is not working. I want the name to show with national characters. Could you help me how to solve this problem? Thanks in advance.

share|improve this question
I think you are doing it right. Let's make some test: Initial string: $name = "test-€$ț" ; Encoded string with urlencode($name): test-%E2%82%AC%24%C8%9B ; Decoded string with URLDecoder.decode(name, "UTF-8"): test-€$ț – Alexandru Pătrănescu Apr 9 at 21:31
Finally, the problem was solved using an answer below. – Tom11 Apr 10 at 10:03

1 Answer

up vote 1 down vote accepted

On the server side try:

urlencode(utf8_encode($name));
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.