@Test public void escape() throws UnsupportedEncodingException { String unicode = new UnicodeEscaper().translate("中国"); System.out.println(unicode); // \u4E2D\u56FD String chinese = new UnicodeUnescaper().translate(unicode); System.out.println(chinese); // 中国 System.out.println(StringEscapeUtils.escapeJava(chinese)); // \u4E2D\u56FD System.out.println(StringEscapeUtils.unescapeJava(unicode)); // 中国 System.out.println(StringEscapeUtils.unescapeJson(unicode)); // 中国 String ns = new String(unicode.getBytes("UTF-8"), "UTF-8"); System.out.println(ns); }