public Method

Converter.def_uconv_convert_if_can(meth, to_enc, from_enc, nkf_arg)

There's no documentation for this item.

Source Code

# File rss/converter.rb, line 71
def def_uconv_convert_if_can(meth, to_enc, from_enc, nkf_arg)
  begin
    require "uconv"
    def_convert(1) do |value|
      "begin\nUconv.\#{meth}(\#{value})\nrescue Uconv::Error\nraise ConversionError.new(\#{value}, \"\#{to_enc}\", \"\#{from_enc}\")\nend\n"
    end
  rescue LoadError
    require 'nkf'
    def_convert(1) do |value|
      "NKF.nkf(#{nkf_arg.dump}, #{value})"
    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.