码迷,mamicode.com
首页 > Web开发 > 详细

URLEncoder、URLDecoder

时间:2018-05-15 15:52:43      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:str   void   cep   urlencode   out   gen   []   class   public   

public static void main(String[] args) {
		String a = "欢迎你";
		try {
			//编码
			String b = URLEncoder.encode(a, "UTF-8");
			System.out.println(b);
			//解码
			String c= URLDecoder.decode(b, "UTF-8");
			System.out.println(c);
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

  

URLEncoder、URLDecoder

标签:str   void   cep   urlencode   out   gen   []   class   public   

原文地址:https://www.cnblogs.com/qqyong123/p/9041020.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!