private static void validateCharacterVal(
            ReadableConfig tableOptions,
            ConfigOption<String> option,
            boolean unescape) {
        if (!tableOptions.getOptional(option).isPresent()) {
            return;
        }

        final String value = unescape
                ? StringEscapeUtils.unescapeJava(tableOptions.get(option))
                : tableOptions.get(option);

        if (value.length() != 1) {
            throw new ValidationException(
                    String.format(
                            "Option '%s.%s' must be a String with single character, but was: %s",
                            KvFormatFactory.IDENTIFIER, option.key(), tableOptions.get(option)));
        }
    }
Commons values and methods for KV format.
inlong-sort/sort-formats/format-rowdata/format-rowdata-kv/src/main/java/org/apache/inlong/sort/formats/kv/KvCommons.java