public static List<String> toFiledList(String fieldValues, char separator) {
        List<String> fields = new ArrayList<String>();
        if (fieldValues.length() <= 0) {
            return fields;
        }

        int fieldLen = fieldValues.length();
        StringBuilder builder = new StringBuilder();
        int i = 0;
        for (; i < fieldLen - 1; i++) {
            char value = fieldValues.charAt(i);
            if (value == '\\') {
                char nextValue = fieldValues.charAt(i + 1);
                switch (nextValue) {
                    case '0':
                        builder.append(0x00);
                        i++;
                        break;
                    case 'n':
                        builder.append('\n');
                        i++;
                        break;
                    case 'r':
                        builder.append('\r');
                        i++;
                        break;
                    case '\\':
                        builder.append('\\');
                        i++;
                        break;
                    default:
                        if (nextValue == separator) {
                            builder.append(separator);
                            i++;
                        } else {
                            builder.append(value);
                        }
                        break;
                }
                if (i == fieldLen - 1) {
                    fields.add(builder.toString());
                }
            } else {
                if (value == separator) {
                    fields.add(builder.toString());
                    builder.delete(0, builder.length());
                } else {
                    builder.append(value);
                }
            }
        }

        if (i == fieldLen - 1) {
            char value = fieldValues.charAt(i);
            if (value == separator) {
                fields.add(builder.toString());
                fields.add("");
            } else {
                builder.append(value);
                fields.add(builder.toString());
            }
        }
        return fields;
    }
Unescape String format field values to String List format by separator.

@param  fieldValues FiledValues in String format.
@param  separator Separator.
@return FiledValues in String List format.
inlong-sort-standalone/sort-standalone-common/src/main/java/org/apache/inlong/sort/standalone/utils/UnescapeHelper.java