Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

encoding.h File Reference

#include <libxml/xmlversion.h>
#include <libxml/tree.h>

Go to the source code of this file.

Classes

struct  _xmlCharEncodingHandler

Typedefs

typedef int(* xmlCharEncodingInputFunc )(unsigned char *out, int *outlen, const unsigned char *in, int *inlen)
typedef int(* xmlCharEncodingOutputFunc )(unsigned char *out, int *outlen, const unsigned char *in, int *inlen)
typedef _xmlCharEncodingHandler xmlCharEncodingHandler
typedef xmlCharEncodingHandlerxmlCharEncodingHandlerPtr

Enumerations

enum  xmlCharEncoding {
  XML_CHAR_ENCODING_ERROR = -1, XML_CHAR_ENCODING_NONE = 0, XML_CHAR_ENCODING_UTF8 = 1, XML_CHAR_ENCODING_UTF16LE = 2,
  XML_CHAR_ENCODING_UTF16BE = 3, XML_CHAR_ENCODING_UCS4LE = 4, XML_CHAR_ENCODING_UCS4BE = 5, XML_CHAR_ENCODING_EBCDIC = 6,
  XML_CHAR_ENCODING_UCS4_2143 = 7, XML_CHAR_ENCODING_UCS4_3412 = 8, XML_CHAR_ENCODING_UCS2 = 9, XML_CHAR_ENCODING_8859_1 = 10,
  XML_CHAR_ENCODING_8859_2 = 11, XML_CHAR_ENCODING_8859_3 = 12, XML_CHAR_ENCODING_8859_4 = 13, XML_CHAR_ENCODING_8859_5 = 14,
  XML_CHAR_ENCODING_8859_6 = 15, XML_CHAR_ENCODING_8859_7 = 16, XML_CHAR_ENCODING_8859_8 = 17, XML_CHAR_ENCODING_8859_9 = 18,
  XML_CHAR_ENCODING_2022_JP = 19, XML_CHAR_ENCODING_SHIFT_JIS = 20, XML_CHAR_ENCODING_EUC_JP = 21, XML_CHAR_ENCODING_ASCII = 22
}

Functions

XMLPUBFUN void XMLCALL xmlInitCharEncodingHandlers (void)
XMLPUBFUN void XMLCALL xmlCleanupCharEncodingHandlers (void)
XMLPUBFUN void XMLCALL xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler)
XMLPUBFUN xmlCharEncodingHandlerPtr
XMLCALL 
xmlGetCharEncodingHandler (xmlCharEncoding enc)
XMLPUBFUN xmlCharEncodingHandlerPtr
XMLCALL 
xmlFindCharEncodingHandler (const char *name)
XMLPUBFUN xmlCharEncodingHandlerPtr
XMLCALL 
xmlNewCharEncodingHandler (const char *name, xmlCharEncodingInputFunc input, xmlCharEncodingOutputFunc output)
XMLPUBFUN int XMLCALL xmlAddEncodingAlias (const char *name, const char *alias)
XMLPUBFUN int XMLCALL xmlDelEncodingAlias (const char *alias)
XMLPUBFUN const char *XMLCALL xmlGetEncodingAlias (const char *alias)
XMLPUBFUN void XMLCALL xmlCleanupEncodingAliases (void)
XMLPUBFUN xmlCharEncoding
XMLCALL 
xmlParseCharEncoding (const char *name)
XMLPUBFUN const char *XMLCALL xmlGetCharEncodingName (xmlCharEncoding enc)
XMLPUBFUN xmlCharEncoding
XMLCALL 
xmlDetectCharEncoding (const unsigned char *in, int len)
XMLPUBFUN int XMLCALL xmlCharEncOutFunc (xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in)
XMLPUBFUN int XMLCALL xmlCharEncInFunc (xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in)
XMLPUBFUN int XMLCALL xmlCharEncFirstLine (xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in)
XMLPUBFUN int XMLCALL xmlCharEncCloseFunc (xmlCharEncodingHandler *handler)
XMLPUBFUN int XMLCALL UTF8Toisolat1 (unsigned char *out, int *outlen, const unsigned char *in, int *inlen)
XMLPUBFUN int XMLCALL isolat1ToUTF8 (unsigned char *out, int *outlen, const unsigned char *in, int *inlen)
XMLPUBFUN int XMLCALL xmlGetUTF8Char (const unsigned char *utf, int *len)
XMLPUBFUN int XMLCALL xmlCheckUTF8 (const unsigned char *utf)
XMLPUBFUN int XMLCALL xmlUTF8Strsize (const xmlChar *utf, int len)
XMLPUBFUN xmlChar *XMLCALL xmlUTF8Strndup (const xmlChar *utf, int len)
XMLPUBFUN xmlChar *XMLCALL xmlUTF8Strpos (const xmlChar *utf, int pos)
XMLPUBFUN int XMLCALL xmlUTF8Strloc (const xmlChar *utf, const xmlChar *utfchar)
XMLPUBFUN xmlChar *XMLCALL xmlUTF8Strsub (const xmlChar *utf, int start, int len)
XMLPUBFUN int XMLCALL xmlUTF8Strlen (const xmlChar *utf)
XMLPUBFUN int XMLCALL xmlUTF8Size (const xmlChar *utf)
XMLPUBFUN int XMLCALL xmlUTF8Charcmp (const xmlChar *utf1, const xmlChar *utf2)


Typedef Documentation

typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler
 

typedef xmlCharEncodingHandler* xmlCharEncodingHandlerPtr
 

typedef int(* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen, const unsigned char *in, int *inlen)
 

xmlCharEncodingInputFunc: : a pointer to an array of bytes to store the UTF-8 result : the length of : a pointer to an array of chars in the original encoding : the length of

Take a block of chars in the original encoding and try to convert it to an UTF-8 block of chars out.

Returns the number of byte written, or -1 by lack of space, or -2 if the transcoding failed. The value of after return is the number of octets consumed as the return value is positive, else unpredictiable. The value of after return is the number of octets consumed.

typedef int(* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen, const unsigned char *in, int *inlen)
 

xmlCharEncodingOutputFunc: : a pointer to an array of bytes to store the result : the length of : a pointer to an array of UTF-8 chars : the length of

Take a block of UTF-8 chars in and try to convert it to an other encoding. Note: a first call designed to produce heading info is called with in = NULL. If stateful this should also initialize the encoder state.

Returns the number of byte written, or -1 by lack of space, or -2 if the transcoding failed. The value of after return is the number of octets consumed as the return value is positive, else unpredictiable. The value of after return is the number of ocetes consumed.


Enumeration Type Documentation

enum xmlCharEncoding
 

xmlCharEncoding:

Predefined values for some standard encodings. Libxml don't do beforehand translation on UTF8, ISOLatinX. It also support UTF16 (LE and BE) by default.

Anything else would have to be translated to UTF8 before being given to the parser itself. The BOM for UTF16 and the encoding declaration are looked at and a converter is looked for at that point. If not found the parser stops here as asked by the XML REC Converter can be registered by the user using xmlRegisterCharEncodingHandler but the current form doesn't allow stateful transcoding (a serious problem agreed !). If iconv has been found it will be used automatically and allow stateful transcoding, the simplest is then to be sure to enable icon and to provide iconv libs for the encoding support needed.

Enumeration values:
XML_CHAR_ENCODING_ERROR 
XML_CHAR_ENCODING_NONE 
XML_CHAR_ENCODING_UTF8 
XML_CHAR_ENCODING_UTF16LE 
XML_CHAR_ENCODING_UTF16BE 
XML_CHAR_ENCODING_UCS4LE 
XML_CHAR_ENCODING_UCS4BE 
XML_CHAR_ENCODING_EBCDIC 
XML_CHAR_ENCODING_UCS4_2143 
XML_CHAR_ENCODING_UCS4_3412 
XML_CHAR_ENCODING_UCS2 
XML_CHAR_ENCODING_8859_1 
XML_CHAR_ENCODING_8859_2 
XML_CHAR_ENCODING_8859_3 
XML_CHAR_ENCODING_8859_4 
XML_CHAR_ENCODING_8859_5 
XML_CHAR_ENCODING_8859_6 
XML_CHAR_ENCODING_8859_7 
XML_CHAR_ENCODING_8859_8 
XML_CHAR_ENCODING_8859_9 
XML_CHAR_ENCODING_2022_JP 
XML_CHAR_ENCODING_SHIFT_JIS 
XML_CHAR_ENCODING_EUC_JP 
XML_CHAR_ENCODING_ASCII 


Function Documentation

XMLPUBFUN int XMLCALL isolat1ToUTF8 unsigned char *  out,
int *  outlen,
const unsigned char *  in,
int *  inlen
 

XMLPUBFUN int XMLCALL UTF8Toisolat1 unsigned char *  out,
int *  outlen,
const unsigned char *  in,
int *  inlen
 

XMLPUBFUN int XMLCALL xmlAddEncodingAlias const char *  name,
const char *  alias
 

XMLPUBFUN int XMLCALL xmlCharEncCloseFunc xmlCharEncodingHandler handler  ) 
 

XMLPUBFUN int XMLCALL xmlCharEncFirstLine xmlCharEncodingHandler handler,
xmlBufferPtr  out,
xmlBufferPtr  in
 

XMLPUBFUN int XMLCALL xmlCharEncInFunc xmlCharEncodingHandler handler,
xmlBufferPtr  out,
xmlBufferPtr  in
 

XMLPUBFUN int XMLCALL xmlCharEncOutFunc xmlCharEncodingHandler handler,
xmlBufferPtr  out,
xmlBufferPtr  in
 

XMLPUBFUN int XMLCALL xmlCheckUTF8 const unsigned char *  utf  ) 
 

XMLPUBFUN void XMLCALL xmlCleanupCharEncodingHandlers void   ) 
 

XMLPUBFUN void XMLCALL xmlCleanupEncodingAliases void   ) 
 

XMLPUBFUN int XMLCALL xmlDelEncodingAlias const char *  alias  ) 
 

XMLPUBFUN xmlCharEncoding XMLCALL xmlDetectCharEncoding const unsigned char *  in,
int  len
 

XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlFindCharEncodingHandler const char *  name  ) 
 

XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlGetCharEncodingHandler xmlCharEncoding  enc  ) 
 

XMLPUBFUN const char* XMLCALL xmlGetCharEncodingName xmlCharEncoding  enc  ) 
 

XMLPUBFUN const char* XMLCALL xmlGetEncodingAlias const char *  alias  ) 
 

XMLPUBFUN int XMLCALL xmlGetUTF8Char const unsigned char *  utf,
int *  len
 

XMLPUBFUN void XMLCALL xmlInitCharEncodingHandlers void   ) 
 

XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlNewCharEncodingHandler const char *  name,
xmlCharEncodingInputFunc  input,
xmlCharEncodingOutputFunc  output
 

XMLPUBFUN xmlCharEncoding XMLCALL xmlParseCharEncoding const char *  name  ) 
 

XMLPUBFUN void XMLCALL xmlRegisterCharEncodingHandler xmlCharEncodingHandlerPtr  handler  ) 
 

XMLPUBFUN int XMLCALL xmlUTF8Charcmp const xmlChar utf1,
const xmlChar utf2
 

XMLPUBFUN int XMLCALL xmlUTF8Size const xmlChar utf  ) 
 

XMLPUBFUN int XMLCALL xmlUTF8Strlen const xmlChar utf  ) 
 

XMLPUBFUN int XMLCALL xmlUTF8Strloc const xmlChar utf,
const xmlChar utfchar
 

XMLPUBFUN xmlChar* XMLCALL xmlUTF8Strndup const xmlChar utf,
int  len
 

XMLPUBFUN xmlChar* XMLCALL xmlUTF8Strpos const xmlChar utf,
int  pos
 

XMLPUBFUN int XMLCALL xmlUTF8Strsize const xmlChar utf,
int  len
 

XMLPUBFUN xmlChar* XMLCALL xmlUTF8Strsub const xmlChar utf,
int  start,
int  len
 


Generated on Wed Mar 16 00:10:30 2005 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1