简体   繁体   中英

Conversion from UTF-8 to actual character in java

I am sending a parameter string value, a french character " ç ", to my web service in JAVA thorough GET method. In java, it is shown in UTF-8 encoded form as %C3%A7 .

How can I convert it back to the same french character during the execution itself?

Tha answer you nned is the one liked by @Joe; you need to "convert" the query string:

String result = java.net.URLDecoder.decode(url, "UTF-8");

It's not a matter of UTF-8 econding, rather a url enconding one.

A side note: in the comments you stated that you are passing the data via GET, if the semantic of the web service is to modify the data I suggest to use the POST method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM