# File lib/action_mailer/vendor/tmail-1.2.7/tmail/quoting.rb, line 104
      def convert_to_with_fallback_on_iso_8859_1(text, to, from)
        return text if to == 'utf-8' and text.isutf8

        if from.blank? and !text.is_binary_data?
          from = CharDet.detect(text)['encoding']

          # Chardet ususally detects iso-8859-2 (aka windows-1250), but the text is
          # iso-8859-1 (aka windows-1252 and Latin1). http://en.wikipedia.org/wiki/ISO/IEC_8859-2
          # This can cause unwanted characters, like ŕ instead of à.
          # (I know, could be a very bad decision...)
          from = 'iso-8859-1' if from =~ /iso-8859-2/i
        end

        begin
          convert_to_without_fallback_on_iso_8859_1(text, to, from)
        rescue Iconv::InvalidCharacter
          unless from == 'iso-8859-1'
            from = 'iso-8859-1'
            retry
          end
        end
      end