W3cubDocs

/Nokogiri

class Nokogiri::EncodingHandler

Parent:
Object

Public Class Methods

Nokogiri::EncodingHandler.[](name) Show source
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;
}

Get the encoding handler for name

Nokogiri::EncodingHandler.alias(from, to) Show 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 from to name to

Nokogiri::EncodingHandler.clear_aliases! Show source
static VALUE
rb_xml_encoding_handler_s_clear_aliases(VALUE klass)
{
  xmlCleanupEncodingAliases();

  return klass;
}

Remove all encoding aliases.

Nokogiri::EncodingHandler.delete(name) Show 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

Public Instance Methods

static VALUE
rb_xml_encoding_handler_name(VALUE self)
{
  xmlCharEncodingHandlerPtr handler;

  Data_Get_Struct(self, xmlCharEncodingHandler, handler);

  return NOKOGIRI_STR_NEW2(handler->name);
}

Get the name of this EncodingHandler

© 2008–2018 Aaron Patterson, Mike Dalessio, Charles Nutter, Sergio Arbeo,
Patrick Mahoney, Yoko Harada, Akinori MUSHA, John Shahid, Lars Kanis
Licensed under the MIT License.
https://nokogiri.org/rdoc/Nokogiri/EncodingHandler.html