fork(1) 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. String str="哈";
  14. byte[] big5=str.getBytes("big5");
  15. byte[] utf8=str.getBytes("utf8");
  16. byte[] deft=str.getBytes();
  17.  
  18. System.out.println("======= BIG-5 =======");
  19. for(byte b:big5) System.out.printf("%02X ",b);
  20. System.out.println();
  21. System.out.println("======= UTF-8 =======");
  22. for(byte b:utf8) System.out.printf("%02X ",b);
  23. System.out.println();
  24. System.out.println("======= Default =======");
  25. for(byte b:deft) System.out.printf("%02X ",b);
  26. System.out.println();
  27. }
  28. }
Success #stdin #stdout 0.1s 380608KB
stdin
Standard input is empty
stdout
======= BIG-5 =======
AB A2 
======= UTF-8 =======
E5 93 88 
======= Default =======
E5 93 88