AutoIt
AutoIt
B-Encode a String for MIME Headers
See more Email Object Examples
Demonstrates the Chilkat Email.BEncodeString method, which converts the Unicode string in the first argument to the charset named in the second argument, B-encodes the resulting multibyte data, and returns the encoded string. This is the representation used for non-ASCII text in MIME header fields.
Background: MIME headers were defined to carry only plain ASCII, so non-ASCII text (accents, non-Latin scripts) must be wrapped in an "encoded-word" per RFC 2047. The B encoding is Base64-based: the text becomes something like
=?utf-8?B?...?=, which mail software recognizes and decodes back to the original characters. There is also a Q (quoted-printable-style) encoding for the same purpose; B-encoding is preferred when most characters are non-ASCII.Chilkat AutoIt Downloads
; Demonstrates the BEncodeString method, which converts a Unicode string to a specified
; charset, B-encodes (RFC 2047) the resulting bytes, and returns the encoded string.
; This is the form used for non-ASCII text in MIME header fields.
$oEmail = ObjCreate("Chilkat.Email")
; B-encode a Unicode string using the utf-8 charset.
Local $sEncoded = $oEmail.BEncodeString("Cafe Meeting Notes","utf-8")
ConsoleWrite("B-encoded: " & $sEncoded & @CRLF)