This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes How to convert query parameter of an url  to UTF-8 format. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to convert query parameter of an url  to UTF-8 format." Watch "How to convert query parameter of an url  to UTF-8 format." New topic
Author

How to convert query parameter of an url to UTF-8 format.

saumyadipa kar
Greenhorn

Joined: Sep 08, 2010
Posts: 1
Hi,

My question is
How to convert query parameter of an url to UTF-8 format.

I have an url string which containing some query parameters of Non Ascii character.When I covert these non Ascii character to UTF-8,
it becomes either "?" or some square symbols.


I want the non ascii character should maintain its state after conversion.

Please suggest some solution for this.

Regards,
Saumya
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19674
    
  18

Welcome to the Ranch!

You can use URLEncoder and URLDecoder for this. Both allow you to specify the encoding then encoding / decoding.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to convert query parameter of an url to UTF-8 format.