Minggu, 13 Mei 2012
encode decode URL
import java.net.URLDecoder;
import java.net.URLEncoder;
String url = "nr1+HgndCZw=";
String encodedurl = "";
try{
encodedurl = URLEncoder.encode(url.toString(),"UTF-8");
System.out.println("================= "+encodedurl);
//String dencodedurl = URLEncoder(url.toString(),"UTF-8");
}catch(UnsupportedEncodingException uee){
System.err.println(uee);
}
try{
String decodedurl = URLDecoder.decode(encodedurl,"UTF-8");
System.out.println("=====decodedurl "+decodedurl);
//String dencodedurl = URLEncoder(url.toString(),"UTF-8");
}catch(UnsupportedEncodingException uee){
System.err.println(uee);
}
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar