System.out.println("中文"); System.out.println("中文".getBytes()); System.out.println("中文".getBytes("GB2312")); System.out.println("中文".getBytes("ISO8859_1")); System.out.println(new String("中文".getBytes())); System.out.println(new String("中文".getBytes(), "GB2312")); System.out.println(new String("中文".getBytes(), "ISO8859_1")); System.out.println(new String("中文".getBytes("GB2312"))); System.out.println(new String("中文".getBytes("GB2312"), "GB2312")); System.out.println(new String("中文".getBytes("GB2312"), "ISO8859_1")); System.out.println(new String("中文".getBytes("ISO8859_1"))); System.out.println(new String("中文".getBytes("ISO8859_1"), "GB2312")); System.out.println(new String("中文".getBytes("ISO8859_1"), "ISO8859_1"));
输出结果:
中文 [B@421faab1 [B@2b71fc7e [B@5ce65a89 中文 涓��� ä¸æ ���� 中文 ÖÐÎÄ ?? ?? ??