static public Method

Converter.new(to_enc, from_enc=nil)

There's no documentation for this item.

Source Code

# File rss/converter.rb, line 9
def initialize(to_enc, from_enc=nil)
  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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.