code: private static void escape(OutputAccessor out, int charToEscape) {
  
          out.write('\\');
          out.write('u');
          if (charToEscape > 0xFF) {
              int hi = (charToEscape >> 8) & 0xFF;
              out.write(HEX_BYTES[hi >> 4]);
              out.write(HEX_BYTES[hi & 0xF]);
              charToEscape &= 0xFF;
          } else {
              out.write((byte) '0');
              out.write((byte) '0');
          }
          // We know it's a control char, so only the last 2 chars are non-0
          out.write(HEX_BYTES[charToEscape >> 4]);
          out.write(HEX_BYTES[charToEscape & 0xF]);
      }
docs: Write a UTF escape sequence using either an one or two-byte seqience.
  
  @param out the output
  @param charToEscape the character to escape.