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 78
    def def_uconv_convert_if_can(meth, to_enc, from_enc, nkf_arg)
      begin
        require "uconv"
        def_convert(1) do |value|
                    begin            Uconv.#{meth}(#{value})          rescue Uconv::Error            raise ConversionError.new(#{value}, "#{to_enc}", "#{from_enc}")          end
        end
      rescue LoadError
        require 'nkf'
        if NKF.const_defined?(:UTF8)
          def_convert(1) do |value|
            "NKF.nkf(#{nkf_arg.dump}, #{value})"
          end
        else
          def_iconv_convert(to_enc, from_enc, 1)
        end
      end
    end
Register or log in to add new notes.