URLEncoderURLDecoder

Posted qqyong

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了URLEncoderURLDecoder相关的知识,希望对你有一定的参考价值。

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();
		}
	}

  

以上是关于URLEncoderURLDecoder的主要内容,如果未能解决你的问题,请参考以下文章