ext/iodine/iodine_helpers.c
/**
Decodes a URL encoded String, returning a new String with the decoded data.
*/
Decodes a URL encoded String, returning a new String with the decoded data.
Decodes a URL encoded String returning a new String with the decoded data .
static VALUE url_decode(VALUE self, VALUE str) {
  Check_Type(str, T_STRING);
  VALUE str2 = rb_str_buf_new(RSTRING_LEN(str));
  ssize_t len =
      http_decode_url(RSTRING_PTR(str2), RSTRING_PTR(str), RSTRING_LEN(str));
  if (len < 0)
    rb_raise(rb_eRuntimeError, "Malformed URL string - couldn't decode.");
  rb_str_set_len(str2, len);
  return str2;
  (void)self;
}
static VALUE url_decode ( VALUE self , VALUE str ) { Check_Type ( str , T_STRING ) ; VALUE str2 = rb_str_buf_new ( RSTRING_LEN ( str ) ) ; ssize_t len = http_decode_url ( RSTRING_PTR ( str2 ) , RSTRING_PTR ( str ) , RSTRING_LEN ( str ) ) ; if ( len < 0 ) rb_raise ( rb_eRuntimeError , " " ) ; rb_str_set_len ( str2 , len ) ; return str2 ; ( void ) self ; }
Decodes a URL encoded String, returning a new String with the decoded data.
Decodes a URL encoded String returning a new String with the decoded data .