fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class SqlQuantumLeap
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. System.out.println("MAIN ARTICLE:\nhttps://s...content-available-to-author-only...p.com/2019/06/26/unicode-escape-sequences-across-various-languages-and-platforms-including-supplementary-characters/");
  10. System.out.println("==============================================\n");
  11.  
  12. // The octal escape sequence uses the ISO-8859-1 character set
  13. System.out.println("Octal notation is \\888 where '888' = 1 - 3 octal digits (values 0 - 7; range 0 - 377):");
  14. System.out.println("\\11 and \\011: tab\11tabby\011tab");
  15. System.out.println("\\7, \\07, and \\007: bell\7bell\07bell\007bell");
  16. System.out.println("\\176 = \176 ; \\177 = \177 ; \\200 = \200 ; \\237 = \237");
  17. System.out.println("\\242 = \242 ; \\377 = \377 ; \\504 = \504");
  18. System.out.println("-------------------------------");
  19.  
  20. System.out.println("BMP Code Point / UTF-16 via \\u: \u0F02");
  21. System.out.println("UTF-16 Surrogate Pair via \\u\\u: \uD83D\uDC7E"); // U+1F47E
  22. System.out.println("-------------------------------");
  23.  
  24. // ---------------------------------------------------------------
  25.  
  26. System.out.println("String constructor: " + new String(
  27. new int[]{ 0x0F02, 32, 65, 32, 0xD83D, 0xDC7E }, 0, 6 )); // U+1F47E
  28.  
  29. char[] tc1 = Character.toChars(0x0F02);
  30. System.out.println("Character.toChars(int) static method (codePoint = U+0F02):");
  31. System.out.println(" Size of array returned for BMP Character: " + tc1.length);
  32. System.out.println(" String created from char[]: " + new String(tc1));
  33.  
  34. char[] tc2 = Character.toChars(0x1F47E);
  35. System.out.println("Character.toChars(int) static method (codePoint = U+1F47E):");
  36. System.out.println(" Size of array returned for Supplementary Character: " + tc2.length);
  37. System.out.println(" String created from char[]: " + new String(tc2));
  38.  
  39. char[] tc3 = new char[] { 65, 66, 67, 68, 69, 70 };
  40. System.out.println("Character.toChars(int, char[], int) static method (codePoint = U+1F47E):");
  41. System.out.println(" Initial String created from char[]: " + new String(tc3));
  42. Character.toChars(0x1F47E, tc3, 2); // insert into middle, between spaces
  43. System.out.println(" String created from char[] after Character.toChars(): " + new String(tc3));
  44. }
  45. }
  46.  
Success #stdin #stdout 0.11s 36300KB
stdin
Standard input is empty
stdout
MAIN ARTICLE:
https://s...content-available-to-author-only...p.com/2019/06/26/unicode-escape-sequences-across-various-languages-and-platforms-including-supplementary-characters/
==============================================

Octal notation is \888 where '888' = 1 - 3 octal digits (values 0 - 7; range 0 - 377):
\11 and \011: tab	tabby	tab
\7, \07, and \007: bellbellbellbell
\176 = ~ ; \177 =  ; \200 = € ; \237 = Ÿ
\242 = ¢ ; \377 = ÿ ; \504 = (4
-------------------------------
BMP Code Point / UTF-16 via \u: ༂
UTF-16 Surrogate Pair via \u\u: 👾
-------------------------------
String constructor: ༂ A 👾
Character.toChars(int) static method (codePoint = U+0F02):
	Size of array returned for BMP Character: 1
	String created from char[]: ༂
Character.toChars(int) static method (codePoint = U+1F47E):
	Size of array returned for Supplementary Character: 2
	String created from char[]: 👾
Character.toChars(int, char[], int) static method (codePoint = U+1F47E):
	Initial String created from char[]: ABCDEF
	String created from char[] after Character.toChars(): AB👾EF