E-mail without MIME support (which is optional) is defined by RFC 5322, and only allows "printable" ASCII characters. MIME extends this standard and allows other encoding schemes for certain fields (subject included).
When encoding a header, you use the "Encoded-Word" method:
The form is: "=?charset?encoding?encoded text?=".
charset may be any character set registered with IANA. Typically it would be the same charset as the message body.
encoding can be either "Q" denoting Q-encoding that is similar to the quoted-printable encoding, or "B" denoting base64 encoding.
encoded text is the Q-encoded or base64-encoded text.
An encoded-word may not be more than 75 characters long, including charset, encoding, encoded text, and delimiters. If it is desirable to
encode more text than will fit in an encoded-word of 75 characters,
multiple encoded-words (separated by CRLF SPACE) may be used.