</pre><p>This is a basic byte in an UTF-8 encoded string. It's unsigned allowing to pinpoint case where char * are assigned to <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * (possibly making serialization back impossible).</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>cur</tt></i>:</span></td><td>the input char *</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>a new <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * or NULL</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>cur</tt></i>:</span></td><td>the input char *</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the len of @cur</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>a new <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * or NULL</td></tr></tbody></table></div></div>
</pre><p>Checks @utf for being valid UTF-8. @utf is assumed to be null-terminated. This function is not super-strict, as it will allow longer UTF-8 sequences than necessary. Note that Java is capable of producing these sequences if provoked. Also note, this routine checks for the 4-byte maximum size, but does not check for 0x10ffff maximum value.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>utf</tt></i>:</span></td><td>Pointer to putative UTF-8 encoded string.</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>value: true if @utf is valid.</td></tr></tbody></table></div></div>
</pre><p>Read the first UTF8 character from @utf</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>utf</tt></i>:</span></td><td>a sequence of UTF-8 encoded bytes</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>a pointer to the minimum number of bytes present in the sequence. This is used to assure the next character is completely contained within the sequence.</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the char value or -1 in case of error, and sets *len to the actual number of bytes consumed (0 in case of error)</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>str1</tt></i>:</span></td><td>the first <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr><tr><td><spanclass="term"><i><tt>str2</tt></i>:</span></td><td>the second <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>1 if they are equal, 0 if they are different</td></tr></tbody></table></div></div>
</pre><p>Formats @msg and places result into @buf.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>buf</tt></i>:</span></td><td>the result buffer.</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the result buffer length.</td></tr><tr><td><spanclass="term"><i><tt>msg</tt></i>:</span></td><td>the message with printf formatting.</td></tr><tr><td><spanclass="term"><i><tt>...</tt></i>:</span></td><td>extra parameters for the message.</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the number of <ahref="libxml2-SAX.html#characters">characters</a> written to @buf or -1 if an error occurs.</td></tr></tbody></table></div></div>
</pre><p>Check if a QName is Equal to a given string</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>pref</tt></i>:</span></td><td>the prefix of the QName</td></tr><tr><td><spanclass="term"><i><tt>name</tt></i>:</span></td><td>the localname of the QName</td></tr><tr><td><spanclass="term"><i><tt>str</tt></i>:</span></td><td>the second <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>1 if they are equal, 0 if they are different</td></tr></tbody></table></div></div>
</pre><p>Formats @msg and places result into @buf.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>buf</tt></i>:</span></td><td>the result buffer.</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the result buffer length.</td></tr><tr><td><spanclass="term"><i><tt>msg</tt></i>:</span></td><td>the message with printf formatting.</td></tr><tr><td><spanclass="term"><i><tt>ap</tt></i>:</span></td><td>extra parameters for the message.</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the number of <ahref="libxml2-SAX.html#characters">characters</a> written to @buf or -1 if an error occurs.</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>str1</tt></i>:</span></td><td>the first <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr><tr><td><spanclass="term"><i><tt>str2</tt></i>:</span></td><td>the second <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the integer result of the comparison</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>str</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * array (haystack)</td></tr><tr><td><spanclass="term"><i><tt>val</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> to search (needle)</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * for the first occurrence or NULL.</td></tr></tbody></table></div></div>
</pre><p>a strcat for array of xmlChar's. Since they are supposed to be encoded in UTF-8 or an encoding with 8bit based chars, we assume a termination mark of '0'.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>cur</tt></i>:</span></td><td>the original <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * array</td></tr><tr><td><spanclass="term"><i><tt>add</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * array added</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>a new <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * containing the concatenated string. The original @cur is reallocated and should not be freed.</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>str</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * array</td></tr><tr><td><spanclass="term"><i><tt>val</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> to search</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * for the first occurrence or NULL.</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>str1</tt></i>:</span></td><td>the first <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr><tr><td><spanclass="term"><i><tt>str2</tt></i>:</span></td><td>the second <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the integer result of the comparison</td></tr></tbody></table></div></div>
</pre><p>a strdup for array of xmlChar's. Since they are supposed to be encoded in UTF-8 or an encoding with 8bit based chars, we assume a termination mark of '0'.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>cur</tt></i>:</span></td><td>the input <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>a new <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * or NULL</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>str</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * array</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the number of <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> contained in the ARRAY.</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>str1</tt></i>:</span></td><td>the first <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr><tr><td><spanclass="term"><i><tt>str2</tt></i>:</span></td><td>the second <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the max comparison length</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the integer result of the comparison</td></tr></tbody></table></div></div>
</pre><p>a strncat for array of xmlChar's, it will extend @cur with the len first bytes of @add. Note that if @len < 0 then this is an API error and NULL will be returned.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>cur</tt></i>:</span></td><td>the original <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * array</td></tr><tr><td><spanclass="term"><i><tt>add</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * array added</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the length of @add</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>a new <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *, the original @cur is reallocated and should not be freed.</td></tr></tbody></table></div></div>
</pre><p>same as xmlStrncat, but creates a new string. The original two strings are not freed. If @len is < 0 then the length will be calculated automatically.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>str1</tt></i>:</span></td><td>first <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> string</td></tr><tr><td><spanclass="term"><i><tt>str2</tt></i>:</span></td><td>second <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> string</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the len of @str2 or < 0</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>a new <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * or NULL</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>str1</tt></i>:</span></td><td>the first <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr><tr><td><spanclass="term"><i><tt>str2</tt></i>:</span></td><td>the second <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the max comparison length</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the integer result of the comparison</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>cur</tt></i>:</span></td><td>the input <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> *</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the len of @cur</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>a new <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * or NULL</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>str</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * array (haystack)</td></tr><tr><td><spanclass="term"><i><tt>val</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> to search (needle)</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * for the first occurrence or NULL.</td></tr></tbody></table></div></div>
<hr/>
<divclass="refsect2"lang="en"><h3><aname="xmlStrsub"/>xmlStrsub ()</h3><preclass="programlisting"><ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlStrsub (const <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <br/> int start, <br/> int len)<br/>
</pre><p>Extract a substring of a given string</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>str</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * array (haystack)</td></tr><tr><td><spanclass="term"><i><tt>start</tt></i>:</span></td><td>the index of the first char (zero based)</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the length of the substring</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * for the first occurrence or NULL.</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>utf1</tt></i>:</span></td><td>pointer to first UTF8 char</td></tr><tr><td><spanclass="term"><i><tt>utf2</tt></i>:</span></td><td>pointer to second UTF8 char</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>result of the compare as with <ahref="libxml2-xmlstring.html#xmlStrncmp">xmlStrncmp</a></td></tr></tbody></table></div></div>
</pre><p>calculates the internal size of a UTF8 character</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>utf</tt></i>:</span></td><td>pointer to the UTF8 character</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the numbers of bytes in the character, -1 on format error</td></tr></tbody></table></div></div>
</pre><p>compute the length of an UTF8 string, it doesn't do a full UTF8 checking of the content of the string.</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>utf</tt></i>:</span></td><td>a sequence of UTF-8 encoded bytes</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the number of <ahref="libxml2-SAX.html#characters">characters</a> in the string or -1 in case of error</td></tr></tbody></table></div></div>
</pre><p>a function to provide the relative location of a UTF8 char</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>utf</tt></i>:</span></td><td>the input UTF8 *</td></tr><tr><td><spanclass="term"><i><tt>utfchar</tt></i>:</span></td><td>the UTF8 character to be found</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the relative character position of the desired char or -1 if not found</td></tr></tbody></table></div></div>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>utf</tt></i>:</span></td><td>the input UTF8 *</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the len of @utf (in chars)</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>a new UTF8 * or NULL</td></tr></tbody></table></div></div>
</pre><p>a function to provide the equivalent of fetching a character from a string array</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>utf</tt></i>:</span></td><td>the input UTF8 *</td></tr><tr><td><spanclass="term"><i><tt>pos</tt></i>:</span></td><td>the position of the desired UTF8 char (in chars)</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the UTF8 character or NULL</td></tr></tbody></table></div></div>
<hr/>
<divclass="refsect2"lang="en"><h3><aname="xmlUTF8Strsize"/>xmlUTF8Strsize ()</h3><preclass="programlisting">int xmlUTF8Strsize (const <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * utf, <br/> int len)<br/>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>utf</tt></i>:</span></td><td>a sequence of UTF-8 encoded bytes</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>the number of <ahref="libxml2-SAX.html#characters">characters</a> in the array</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>the storage size of the first 'len' <ahref="libxml2-SAX.html#characters">characters</a> of ARRAY</td></tr></tbody></table></div></div>
<hr/>
<divclass="refsect2"lang="en"><h3><aname="xmlUTF8Strsub"/>xmlUTF8Strsub ()</h3><preclass="programlisting"><ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlUTF8Strsub (const <ahref="libxml2-xmlstring.html#xmlChar">xmlChar</a> * utf, <br/> int start, <br/> int len)<br/>
</pre><p>Create a substring from a given UTF-8 string Note: positions are given in units of UTF-8 chars</p>
<divclass="variablelist"><tableborder="0"><colalign="left"/><tbody><tr><td><spanclass="term"><i><tt>utf</tt></i>:</span></td><td>a sequence of UTF-8 encoded bytes</td></tr><tr><td><spanclass="term"><i><tt>start</tt></i>:</span></td><td>relative pos of first char</td></tr><tr><td><spanclass="term"><i><tt>len</tt></i>:</span></td><td>total number to copy</td></tr><tr><td><spanclass="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to a newly created string or NULL if any problem</td></tr></tbody></table></div></div>