fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. byte[] big5Bytes=new byte[]{ (byte)0xAB , (byte)0xA2 };
  14. String strBig5=new String(big5Bytes,"Big5");
  15. String strUTF8=new String(big5Bytes,"UTF8");
  16. String strDefault=new String(big5Bytes);
  17. System.out.println("======== Big 5 ==========");
  18. System.out.println(strBig5);
  19. System.out.println("======== UTF 8 ==========");
  20. System.out.println(strUTF8);
  21. System.out.println("======== Default ==========");
  22. System.out.println(strDefault);
  23.  
  24. }
  25. }
Success #stdin #stdout 0.09s 380608KB
stdin
Standard input is empty
stdout
======== Big 5 ==========
哈
======== UTF 8 ==========
��
======== Default ==========
��