class Nokogiri::EncodingHandler

Public Class Methods

Nokogiri::EncodingHandler.[](name) click to toggle source

Get the encoding handler for name

static VALUE
rb_xml_encoding_handler_s_get(VALUE klass, VALUE key)
{
  xmlCharEncodingHandlerPtr handler;

  handler = xmlFindCharEncodingHandler(StringValueCStr(key));
  if (handler) {
    return Data_Wrap_Struct(klass, NULL, _xml_encoding_handler_dealloc, handler);
  }

  return Qnil;
}
Nokogiri::EncodingHandler.alias(from, to) click to toggle source

Alias encoding handler with name from to name to

static VALUE
rb_xml_encoding_handler_s_alias(VALUE klass, VALUE from, VALUE to)
{
  xmlAddEncodingAlias(StringValueCStr(from), StringValueCStr(to));

  return to;
}
Nokogiri::EncodingHandler.clear_aliases! click to toggle source

Remove all encoding aliases.

static VALUE
rb_xml_encoding_handler_s_clear_aliases(VALUE klass)
{
  xmlCleanupEncodingAliases();

  return klass;
}
Nokogiri::EncodingHandler.delete(name) click to toggle source

Delete the encoding alias named name

static VALUE
rb_xml_encoding_handler_s_delete(VALUE klass, VALUE name)
{
  if (xmlDelEncodingAlias(StringValueCStr(name))) { return Qnil; }

  return Qtrue;
}

Public Instance Methods

name click to toggle source

Get the name of this EncodingHandler

static VALUE
rb_xml_encoding_handler_name(VALUE self)
{
  xmlCharEncodingHandlerPtr handler;

  Data_Get_Struct(self, xmlCharEncodingHandler, handler);

  return NOKOGIRI_STR_NEW2(handler->name);
}