method
def_iconv_convert
def_iconv_convert(to_enc, from_enc, depth=0)
public
Hide source
# File lib/rss/converter.rb, line 42 def def_iconv_convert(to_enc, from_enc, depth=0) begin require "iconv" @iconv = Iconv.new(to_enc, from_enc) def_convert(depth+1) do |value| "begin\n@iconv.iconv(\#{value})\nrescue Iconv::Failure\nraise ConversionError.new(\#{value}, \"\#{to_enc}\", \"\#{from_enc}\")\nend\n" end rescue LoadError, ArgumentError, SystemCallError raise UnknownConversionMethodError.new(to_enc, from_enc) end end