docs: public static void stringToUnicodeBytes(HsqlByteArrayOutputStream b,
              String s, boolean doubleSingleQuotes) {
  
          final int len = s.length();
          char[]    chars;
          int       extras = 0;
  
          if (s == null || len == 0) {
              return;
          }
  
          chars = s.toCharArray();
  
          b.ensureRoom(len * 2 + 5);
  
          for (int i = 0; i < len; i++) {
              char c = chars[i];
  
              if (c == '\\') {
                  if ((i < len - 1) && (chars[i + 1] == 'u')) {
                      b.writeNoCheck(c);    // encode the \ as unicode, so 'u' is ignored
                      b.writeNoCheck('u');
                      b.writeNoCheck('0');
                      b.writeNoCheck('0');
                      b.writeNoCheck('5');
                      b.writeNoCheck('c');
  
                      extras += 5;
                  } else {
                      b.write(c);
                  }
              } else if ((c >= 0x0020) && (c <= 0x007f)) {
                  b.writeNoCheck(c);        // this is 99%
  
                  if (c == '\'' && doubleSingleQuotes) {
                      b.writeNoCheck(c);
  
                      extras++;
                  }
              } else {
                  b.writeNoCheck('\\');
                  b.writeNoCheck('u');
                  b.writeNoCheck(HEXBYTES[(c >> 12) & 0xf]);
                  b.writeNoCheck(HEXBYTES[(c >> 8) & 0xf]);
                  b.writeNoCheck(HEXBYTES[(c >> 4) & 0xf]);
                  b.writeNoCheck(HEXBYTES[c & 0xf]);
  
                  extras += 5;
              }
  
              if (extras > len) {
                  b.ensureRoom(len + extras + 5);
  
                  extras = 0;
              }
          }
      }