It seems the header value is always encoded as "ISO8859-1".
it is possible. read here: http://www.ietf.org/rfc/rfc2047.txt
briefly. you write in header: =?UTF-8?B?0YTRi9Cy?=
, where UTF-8
is encoding, B
is for Base64 (may be Q for quoted-pritable), 0YTRi9Cy
is actual encoded data (here some text in Russian)
encoded-word = "=?" charset "?" encoding "?" encoded-text "?="
charset = token ; see section 3
encoding = token ; see section 4
token = 1*
especials = "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / " <"> / "/" / "[" / "]" / "?" / "." / "="
encoded-text = 1* ; (but see "Use of encoded-words in message ; headers", section 5)
It depends on the header.
As far as I can tell, there is no interoperable support for RFC 2047 encoding in HTTP headers, nor is it clear from RFC 2616 where it could be allowed.
The new HTTP spec won't mention RFC 2047 encoding anymore (see Ticket 111).
For headers that use parameters (such as Content-Type or Content-Disposition), the encoding defined in RFC 2231 can be an alternative.