private void writeMaybeQuoted(final String content, boolean requireQuotes) throws IOException {
    if (!requireQuotes) {
      for (int i = 0; i < content.length(); ++i) {
        if (!Tokens.id(content.charAt(i))) {
          requireQuotes = true;
          break;
        }
      }
    }
    if (requireQuotes) { // TODO: single quotes
      this.out.append(Tokens.DOUBLE_QUOTE);
      this.out.append(escape(content, Tokens.DOUBLE_QUOTE));
      this.out.append(Tokens.DOUBLE_QUOTE);
    } else {
      this.out.append(content);
    }
  }
Whether a {@link Tokens#VALUE_SEPARATOR} needs to be printed before the beginning of the next object.
nbt/src/main/java/net/kyori/adventure/nbt/TagStringWriter.java