new(to_enc, from_enc=nil)
public
Hide source
# File lib/rss/converter.rb, line 10 def initialize(to_enc, from_enc=nil) if "".respond_to?(:encode) @to_encoding = to_enc return end normalized_to_enc = to_enc.downcase.gsub(/-/, '_') from_enc ||= 'utf-8' normalized_from_enc = from_enc.downcase.gsub(/-/, '_') if normalized_to_enc == normalized_from_enc def_same_enc() else def_diff_enc = "def_to_#{normalized_to_enc}_from_#{normalized_from_enc}" if respond_to?(def_diff_enc) __send__(def_diff_enc) else def_else_enc(to_enc, from_enc) end end end