Flowdock
def_uconv_convert_if_can(meth, to_enc, from_enc, nkf_arg) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/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
Register or log in to add new notes.