How to encode urls with URLEncoder

import java.net.URLEncoder;

String encodedUrl = URLEncoder.encode("Encode me the string", "UTF-8");

You must supply the second parameter UTF-8 otherwise that method is deprecated.

Use URLDecoder.decode("Blah", "UTF-8") to decode urls.

References

Page Comments (Click to edit)






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.