URLEncoding of URLs with UTF-8 characters
843834Sep 13 2002 — edited Sep 24 2002Hi,
I'm trying to URL encode a URL with some chinese characters in them. But it isnt working properly.
i.e. When i decode back the encdoed URL (using java.net.URLDEncoder.decode(String) & java.net.URLDecoder.decode(string) respectively), I dont get the same URL back... The chinese characters are lost some how...
I tried writing it to a file instead of printing the out put, but no luck...
input URL=http://down.chinamp3.com/down.php?id=70201&song_name=I%20Will%20Be%20Fine&singer_name=莫文蔚
encoded URL=http%3a//down.chinamp3.com/down.php%3fid%3d70201%26song_name%3dI%2520Will%2520Be%2520Fine%26singer_name%3d%e8%8e%ab%e6%96%87%e8%94%9a
decoded URL=http://down.chinamp3.com/down.php?id=70201&song_name=I%20Will%20Be%20Fine&singer_name=���������������������
Where as the decode URL should be same as the input URL!!!!
I'm completely stuck, Some advice will be highly appreciated!
Regards
Pratim