class Nokogiri::EncodingHandler
Constants
- USEFUL_ALIASES
-
Popular encoding aliases not known by all iconv implementations that
Nokogiri
should support.
Public Class Methods
Source
static VALUE rb_xml_encoding_handler_s_get(VALUE klass, VALUE key) { xmlCharEncodingHandlerPtr handler; handler = xmlFindCharEncodingHandler(StringValueCStr(key)); if (handler) { return TypedData_Wrap_Struct(klass, &xml_encoding_handler_type, handler); } return Qnil; }
Get the encoding handler for name
Source
static VALUE rb_xml_encoding_handler_s_alias(VALUE klass, VALUE from, VALUE to) { xmlAddEncodingAlias(StringValueCStr(from), StringValueCStr(to)); return to; }
Alias encoding handler with name real_name
to name alias_name
Source
static VALUE rb_xml_encoding_handler_s_clear_aliases(VALUE klass) { xmlCleanupEncodingAliases(); return klass; }
Remove all encoding aliases.
Source
static VALUE rb_xml_encoding_handler_s_delete(VALUE klass, VALUE name) { if (xmlDelEncodingAlias(StringValueCStr(name))) { return Qnil; } return Qtrue; }
Delete the encoding alias named name
Source
# File lib/nokogiri/encoding_handler.rb, line 15 def install_default_aliases USEFUL_ALIASES.each do |alias_name, name| EncodingHandler.alias(name, alias_name) if EncodingHandler[alias_name].nil? end end
Public Instance Methods
Source
static VALUE rb_xml_encoding_handler_name(VALUE self) { xmlCharEncodingHandlerPtr handler; TypedData_Get_Struct(self, xmlCharEncodingHandler, &xml_encoding_handler_type, handler); return NOKOGIRI_STR_NEW2(handler->name); }
Get the name of this EncodingHandler