code: private static void escape(final String label, final StringBuilder builder) {
          final int length = label.length();
          for (int i = 0; i < length; ++i) {
              final char c = label.charAt(i);
              if (c == '\\') {
                  builder.append("\\\\");
              } else if (c == '"') {
                  builder.append("\\\"");
              } else if (c == '\n') {
                  builder.append("\\n");
              } else if (c == '\r') {
                  builder.append("\\r");
              } else if (c == '\t') {
                  builder.append("\\t");
              }
              // TODO: not accepted by Virtuoso :-(
              // else if (c >= 0x0 && c <= 0x8 || c == 0xB || c == 0xC || c >= 0xE && c <= 0x1F
              // || c >= 0x7F && c <= 0xFFFF) {
              // builder.append("\\u").append(
              // Strings.padStart(Integer.toHexString(c).toUpperCase(), 4, '0'));
              // } else if (c >= 0x10000 && c <= 0x10FFFF) {
              // builder.append("\\U").append(
              // Strings.padStart(Integer.toHexString(c).toUpperCase(), 8, '0'));
              // }
              else {
                  builder.append(Character.toString(c));
              }
          }
      }
docs: Helper functions