private static void encodeFilename(StringBuilder sb, String input, Charset charset) {
        final byte[] source = input.getBytes(charset);
        sb.append(charset.name());
        sb.append("''");
        for (byte b : source) {
            if (isRFC5987AttrChar(b)) {
                sb.append((char) b);
            } else {
                sb.append('%');
                final char hex1 = Ascii.toUpperCase(Character.forDigit((b >> 4) & 0xF, 16));
                final char hex2 = Ascii.toUpperCase(Character.forDigit(b & 0xF, 16));
                sb.append(hex1);
                sb.append(hex2);
            }
        }
    }
Encodes the given header field param as describe in RFC 5987.

@param input the header field param
@param charset the charset of the header field param string,
               only the US-ASCII, UTF-8 and ISO-8859-1 charsets are supported
@see <a href="https://datatracker.ietf.org/doc/rfc5987/">RFC 5987</a>
core/src/main/java/com/linecorp/armeria/common/ContentDisposition.java