# class Mail::Ruby19::BestEffortCharsetEncoder

### Public Instance Methods

encode(string, charset) click to toggle source

    # File lib/mail/version_specific/ruby_1_9.rb, line 11
    def encode(string, charset)
      string.force_encoding(pick_encoding(charset))
    end

### Private Instance Methods

pick_encoding(charset) click to toggle source

    # File lib/mail/version_specific/ruby_1_9.rb, line 17
    def pick_encoding(charset)
      charset = case charset
      when /ansi_x3.110-1983/
        'ISO-8859-1'
      when /Windows-?1258/i # Windows-1258 is similar to 1252
        "Windows-1252"
      else
        charset
      end
      Mail::Ruby19.pick_encoding(charset)
    end