public static void main(String[] args) throws Exception { String hello = URLEncoder.encode("大家好才是真的好", "UTF-8"); System.out.println(hello); hello = URLDecoder.decode(hello, "UTF-8"); System.out.println(hello); }