Encode UTF-8 subjects and attachment names properly (#2207).