private static int encodeQuotedPrintableHeader(ByteBuf buffer, String text, int posInLine) {
        byte[] textBytes = text.getBytes(StandardCharsets.UTF_8);
        buffer.writeBytes(QP_PREFIX);
        int pos = QP_PREFIX_LENGTH + posInLine;
        for (byte b : textBytes) {
            int c = b & 0xFF;
            if (c == '\r' || c == '\n') {
                continue;
            }
            byte[] bytes = CHAR_ENCODING.get(b);
            pos += bytes.length;
            // -1 for "="
            if (pos <= SOFT_LINE_LIMIT_EXCLUDING_CRLF_WHITESPACE - QP_SUFFIX_LENGTH - 1) {
                buffer.writeByte(ESCAPE_CHAR)
                        .writeBytes(bytes);
            } else {
                buffer.writeBytes(SUFFIX_CRLF_PREFIX)
                        .writeByte(ESCAPE_CHAR)
                        .writeBytes(bytes);
                // 11 for " =?UTF-8?Q?"
                pos = 11 + 3;
            }
        }
        buffer.writeBytes(QP_SUFFIX);
        return pos;
    }
TODO: handle especials
<p>
https://www.rfc-editor.org/rfc/rfc2047

@param posInLine starts from 0
@return position
turms-plugins/turms-plugin-push/src/main/java/im/turms/plugin/push/core/smtp/codec/MailEncoder.java