Module: URI

Defined in:
lib/decode_www_form_component.rb,
ext/decode_www_form_component/decode_www_form_component.c

Class Method Summary collapse

Class Method Details

.decode_www_form_component(str, enc = Encoding::UTF_8) ⇒ Object

Raises:

  • (ArgumentError)


8
9
10
11
12
# File 'lib/decode_www_form_component.rb', line 8

def self.decode_www_form_component(str, enc=Encoding::UTF_8)
  r = decode_www_form_component_internal(str)
  raise ArgumentError, "invalid %-encoding (#{str})" if r.nil?
  r.force_encoding(enc)
end

.decode_www_form_component_internal(string) ⇒ Object



54
55
56
57
58
# File 'ext/decode_www_form_component/decode_www_form_component.c', line 54

static VALUE rb_decode_www_form_component_internal(VALUE mod, VALUE string)
{
    Check_Type(string, T_STRING);
    return decode_uri(string);
}