Hash :
2ad1dfff
Author :
Date :
2003-11-15T10:35:20
rebuilt the generated pages (again), manually restored doc/html/index.html * doc/Makefile.am doc/*.html doc/html/*.html: rebuilt the generated pages (again), manually restored doc/html/index.html and manually edited generated file doc/gnome-xml.xml to put in appropriate headings. * doc/docdescr.doc: new file to describe details of the document generation (helps my memory for the next time) * genChRanges.py,chvalid.c,include/libxml/chvalid.h: minor enhancement to please the automatic documentation generation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>encoding</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><meta name="generator" content="GTK-Doc V1.1 (XML mode)"><style type="text/css">
.synopsis, .classsynopsis {
background: #eeeeee;
border: solid 1px #aaaaaa;
padding: 0.5em;
}
.programlisting {
background: #eeeeff;
border: solid 1px #aaaaff;
padding: 0.5em;
}
.variablelist {
padding: 4px;
margin-left: 3em;
}
.navigation {
background: #ffeeee;
border: solid 1px #ffaaaa;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.navigation a {
color: #770000;
}
.navigation a:visited {
color: #550000;
}
.navigation .title {
font-size: 200%;
}
</style><link rel="home" href="index.html" title="Gnome XML Library Reference Manual "><link rel="up" href="ch01.html" title="Libxml Programming Notes"><link rel="previous" href="libxml-wsockcompat.html" title="wsockcompat"><link rel="next" href="libxml-xmlregexp.html" title="xmlregexp"></head><body text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-wsockcompat.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">Gnome XML Library Reference Manual </th><td><a accesskey="n" href="libxml-xmlregexp.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry"><a name="libxml-encoding"></a><div class="titlepage"></div><div class="refnamediv"><h2>encoding</h2><p>encoding — </p></div><div class="refsynopsisdiv"><h2><h1 class="title"><a name="id2614988"></a>Synopsis</h1></h2><pre class="synopsis">
enum <a href="libxml-encoding.html#xmlCharEncoding">xmlCharEncoding</a>;
int (<a href="libxml-encoding.html#xmlCharEncodingInputFunc">*xmlCharEncodingInputFunc</a>) (unsigned char *out,
int *outlen,
unsigned char *in,
int *inlen);
int (<a href="libxml-encoding.html#xmlCharEncodingOutputFunc">*xmlCharEncodingOutputFunc</a>) (unsigned char *out,
int *outlen,
unsigned char *in,
int *inlen);
struct <a href="libxml-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a>;
typedef <a href="libxml-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a>;
</pre></div><div class="refsect1"><h2>Description</h2><p>
</p></div><div class="refsect1"><h2>Details</h2><div class="refsect2"><h3><a name="xmlCharEncoding"></a>enum xmlCharEncoding</h3><pre class="programlisting">typedef enum {
XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */
XML_CHAR_ENCODING_NONE= 0, /* No char encoding detected */
XML_CHAR_ENCODING_UTF8= 1, /* UTF-8 */
XML_CHAR_ENCODING_UTF16LE= 2, /* UTF-16 little endian */
XML_CHAR_ENCODING_UTF16BE= 3, /* UTF-16 big endian */
XML_CHAR_ENCODING_UCS4LE= 4, /* UCS-4 little endian */
XML_CHAR_ENCODING_UCS4BE= 5, /* UCS-4 big endian */
XML_CHAR_ENCODING_EBCDIC= 6, /* EBCDIC uh! */
XML_CHAR_ENCODING_UCS4_2143=7, /* UCS-4 unusual ordering */
XML_CHAR_ENCODING_UCS4_3412=8, /* UCS-4 unusual ordering */
XML_CHAR_ENCODING_UCS2= 9, /* UCS-2 */
XML_CHAR_ENCODING_8859_1= 10,/* ISO-8859-1 ISO Latin 1 */
XML_CHAR_ENCODING_8859_2= 11,/* ISO-8859-2 ISO Latin 2 */
XML_CHAR_ENCODING_8859_3= 12,/* ISO-8859-3 */
XML_CHAR_ENCODING_8859_4= 13,/* ISO-8859-4 */
XML_CHAR_ENCODING_8859_5= 14,/* ISO-8859-5 */
XML_CHAR_ENCODING_8859_6= 15,/* ISO-8859-6 */
XML_CHAR_ENCODING_8859_7= 16,/* ISO-8859-7 */
XML_CHAR_ENCODING_8859_8= 17,/* ISO-8859-8 */
XML_CHAR_ENCODING_8859_9= 18,/* ISO-8859-9 */
XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */
XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
XML_CHAR_ENCODING_ASCII= 22 /* pure ASCII */
} xmlCharEncoding;
</pre><p>
Predefined values for some standard encodings.
Libxml don't do beforehand translation on UTF8, ISOLatinX.
It also support UTF16 (LE and BE) by default.
</p><p>
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.</p><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlCharEncodingInputFunc"></a>xmlCharEncodingInputFunc ()</h3><pre class="programlisting">int (*xmlCharEncodingInputFunc) (unsigned char *out,
int *outlen,
unsigned char *in,
int *inlen);</pre><p>
Take a block of chars in the original encoding and try to convert
it to an UTF-8 block of chars out.</p><p>
</p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td> a pointer to an array of bytes to store the UTF-8 result
</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td> the length of <i><tt>out</tt></i>
</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td> a pointer to an array of chars in the original encoding
</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td> the length of <i><tt>in</tt></i>
</td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>the number of byte written, or -1 by lack of space, or -2
if the transcoding failed.
The value of <i><tt>inlen</tt></i> after return is the number of octets consumed
as the return value is positive, else unpredictiable.
The value of <i><tt>outlen</tt></i> after return is the number of octets consumed.
</td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlCharEncodingOutputFunc"></a>xmlCharEncodingOutputFunc ()</h3><pre class="programlisting">int (*xmlCharEncodingOutputFunc) (unsigned char *out,
int *outlen,
unsigned char *in,
int *inlen);</pre><p>
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.</p><p>
</p><div class="variablelist"><table border="0"><col align="left"><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td> a pointer to an array of bytes to store the result
</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td> the length of <i><tt>out</tt></i>
</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td> a pointer to an array of UTF-8 chars
</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td> the length of <i><tt>in</tt></i>
</td></tr><tr><td><span class="term"><span class="emphasis"><i>Returns</i></span> :</span></td><td>the number of byte written, or -1 by lack of space, or -2
if the transcoding failed.
The value of <i><tt>inlen</tt></i> after return is the number of octets consumed
as the return value is positive, else unpredictiable.
The value of <i><tt>outlen</tt></i> after return is the number of ocetes consumed.
</td></tr></tbody></table></div></div><hr><div class="refsect2"><h3><a name="xmlCharEncodingHandler"></a>struct xmlCharEncodingHandler</h3><pre class="programlisting">struct xmlCharEncodingHandler {
char *name;
xmlCharEncodingInputFunc input;
xmlCharEncodingOutputFunc output;
#ifdef LIBXML_ICONV_ENABLED
iconv_t iconv_in;
iconv_t iconv_out;
#endif /* LIBXML_ICONV_ENABLED */
};
</pre><p>
</p></div><hr><div class="refsect2"><h3><a name="xmlCharEncodingHandlerPtr"></a>xmlCharEncodingHandlerPtr</h3><pre class="programlisting">typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
</pre><p>
</p></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libxml-wsockcompat.html"><b><< wsockcompat</b></a></td><td align="right"><a accesskey="n" href="libxml-xmlregexp.html"><b>xmlregexp >></b></a></td></tr></table></body></html>