/*
 * call-seq:
 *   encoding
 *
 * Get the encoding for the document
 */
static VALUE encoding(VALUE self)
{
  xmlTextReaderPtr reader;
  Data_Get_Struct(self, xmlTextReader, reader);
  const char * encoding = (const char *)xmlTextReaderConstEncoding(reader);
  if(encoding == NULL) return Qnil;

  return rb_str_new2(encoding);
}