/**
 * Charset normalization for incoming email bodies. Two corrections, both
 * applied by rewriting the part's `charset=` declaration before the parser
 * decodes it:
 *
 *  1. Mis-declared UTF-8: PHPMailer-style senders declare `iso-8859-1`
 *     (the PHP default) but emit UTF-8 bytes. When the raw body really is
 *     valid UTF-8, rewrite the declaration to utf-8.
 *
 *  2. iso-8859-1 → windows-1252: senders that genuinely mean a legacy
 *     8-bit charset overwhelmingly emit Windows-1252, not strict
 *     ISO-8859-1 — smart quotes / em-dash / euro live in 0x80-0x9F, which
 *     ISO-8859-1 leaves as unusable C1 control codes. The WHATWG / browser
 *     standard is to decode `iso-8859-1` AS `windows-1252`; iconv-lite
 *     does not, so we rewrite the declaration. windows-1252 is a strict
 *     superset of printable ISO-8859-1, so a genuine ISO-8859-1 char is
 *     never lost.
 */
/** Returns either the original buffer (no change needed) or a copy with
 *  the leading charset declaration corrected. */
export declare function sniffAndFixCharset(raw: Buffer): Buffer;
/** String form of sniffAndFixCharset — for the preview path, which parses
 *  the message as a string (extractPreview). Same two corrections, applied
 *  to the charset declaration in the text. The UTF-8-misdeclare correction
 *  can't be done on a string (the bytes are already decoded), so this only
 *  does correction 2 (iso-8859-1 → windows-1252), which is a pure
 *  declaration rewrite and the common case for previews. */
export declare function fixCharsetDeclString(s: string): string;
//# sourceMappingURL=charset.d.ts.map