fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. printf("\\x can escape a single hex digit: TAB\x9TAB");
  5. printf("\n\n");
  6.  
  7. printf("Three UTF-8 bytes via \\x: \xE0\xBC\x82"); // U+0F02
  8. printf("\n");
  9. printf("Four UTF-8 bytes via \\x: \xF0\x9F\x91\xBE"); // U+1F47E
  10.  
  11. printf("\n\n");
  12.  
  13. printf("The \\U syntax requires 8 hex digits (first two are always 0):\n");
  14. printf("Code Point / UTF-32 via \\U: \U00000F02");
  15. printf("\n");
  16. printf("Code Point / UTF-32 via \\U: \U0001F47E");
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
\x can escape a single hex digit: TAB	TAB

Three UTF-8 bytes via \x: ༂
Four UTF-8 bytes via \x: 👾

The \U syntax requires 8 hex digits (first two are always 0):
Code Point / UTF-32 via \U: ༂
Code Point / UTF-32 via \U: 👾