Skip to content

Commit

Permalink
Fix up improper calling of rb_raise when setting invalid encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie Savage committed Aug 1, 2011
1 parent eae81b2 commit c3a283f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/libxml/ruby_xml_parser_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ static VALUE rxml_parser_context_encoding_set(VALUE self, VALUE encoding)
xmlCharEncodingHandlerPtr hdlr = xmlFindCharEncodingHandler(xencoding);

if (!hdlr)
rb_raise(rb_eRuntimeError, "Unknown encoding: %s", encoding);
rb_raise(rb_eArgError, "Unknown encoding: %i", NUM2INT(encoding));

Data_Get_Struct(self, xmlParserCtxt, ctxt);
result = xmlSwitchToEncoding(ctxt, hdlr);
Expand Down

0 comments on commit c3a283f

Please sign in to comment.