Example of java Chinese transcoding, used to deal with garbled

xiaoxiao2021-03-06  89

Public class helloworld {public static void main (string [] argv) {try {system.out.println ("Chinese); // 1 system.out.println (" Chinese ".getbytes ()); // 2 System .out.println ("Chinese" .getbytes ("GB2312")); // 3 System.out.Println ("Chinese" .GetBytes ("ISO8859_1")); // 4 System.out.println (New String "Chinese" .getbytes ()); // 5 System.out.println ("Chinese" .GetBytes (), "GB2312")); //6 System.out.Println (New String " ".getbytes ()," ISO8859_1 ")); // 7 System.out.println (" Chinese ".GetBytes (" GB2312 "))); // 8 System.out.Println (New String" Chinese .getbytes ("GB2312"), "GB2312")); // 9 System.out.Println ("Chinese" .GetBytes ("GB2312"), "ISO8859_1")); // 10 System. Out.println ("Chinese" .GetBytes)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))); // 11 System.out.Println (New String ("Chinese" .GetBytes ("ISO8859_1"), "GB2312"); / / 12 System.out.Println ("Chinese" .GetBytes ("ISO8859_1"), "ISO8859_1")); // 13} catch (Exception E) {E.PrintStack Trace ();}}}

转载请注明原文地址:https://www.9cbs.com/read-123277.html

New Post(0)