Module: Mail::Jenc::UnstructuredFieldPatch
- Defined in:
- lib/mail/jenc/fields/unstructured_field_patch.rb
Instance Method Summary collapse
Instance Method Details
#initialize(name, value, charset = nil) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/mail/jenc/fields/unstructured_field_patch.rb', line 4 def initialize(name, value, charset = nil) if Jenc.enabled? if value.is_a?(String) if value.ascii_only? charset = 'us-ascii' value.force_encoding('us-ascii') elsif charset && charset != 'utf-8' value = Mail::Encodings.b_value_encode( Mail::Encodings.transcode_charset(value, value.encoding, charset) ) end end end super end |