module EncodingSpecs
  class UndefinedConversionError
    def self.exception
      ec = Encoding::Converter.new('utf-8','ascii')
      begin
        ec.convert("\u{8765}")
      rescue Encoding::UndefinedConversionError => e
        e
      end
    end
  end
  
  class UndefinedConversionErrorIndirect
    def self.exception
      ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP")
      begin
        ec.convert("\xA0")
      rescue Encoding::UndefinedConversionError => e
        e
      end
    end
  end
end

module EncodingSpecs
  class UndefinedConversionError
    def self.exception
      ec = Encoding::Converter.new('utf-8','ascii')
      begin
        ec.convert("\u{8765}")
      rescue Encoding::UndefinedConversionError => e
        e
      end
    end
  end
  
  class UndefinedConversionErrorIndirect
    def self.exception
      ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP")
      begin
        ec.convert("\xA0")
      rescue Encoding::UndefinedConversionError => e
        e
      end
    end
  end

  class InvalidByteSequenceError
    def self.exception
      ec = Encoding::Converter.new("utf-8", "iso-8859-1")
      begin
        ec.convert("\xf1abcd")
      rescue Encoding::InvalidByteSequenceError => e
        e
      end
    end
  end
  
  class InvalidByteSequenceErrorIndirect
    def self.exception
      ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
      begin
        ec.convert("abc\xA1\xFFdef")
      rescue Encoding::InvalidByteSequenceError => e
        e
      end
    end
  end
end

Expand fixtures file for InvalidByteSequenceError
Encoding: Expand fixtures file for InvalidByteSequenceError
