I would like to encode a string to utf-8, the code is:
URLEncoder.encode("http://www.example.com/sf?s=191ae04f&an=马赛克.jpg","UTF-8");
and the result is:
http%3A%2F%2Fwww.example.com%2Fsf%3Fs%3D191ae04f%26an%3D%C2%ED%C8%FC%BF%CB.jpg
as you can see, the punctuation characters,such as : / ? &
, have been encoded in utf-8, but what result I would like to see is:
http://www.example.com/sf?s=191ae04f&an=%C2%ED%C8%FC%BF%CB.jpg
Is there anything wrong?