<refentry id="camel-camel-utf8">
<refmeta>
<refentrytitle role="top_of_page" id="camel-camel-utf8.top_of_page">camel-utf8</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAMEL Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>camel-utf8</refname>
<refpurpose></refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv id="camel-camel-utf8.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
<link linkend="void">void</link>                <link linkend="camel-utf8-putc">camel_utf8_putc</link>                     (unsigned <link linkend="char">char</link> **ptr,
                                                         <link linkend="guint32">guint32</link> c);
<link linkend="guint32">guint32</link>             <link linkend="camel-utf8-getc">camel_utf8_getc</link>                     (unsigned <link linkend="char">char</link> **ptr);
<link linkend="guint32">guint32</link>             <link linkend="camel-utf8-getc-limit">camel_utf8_getc_limit</link>               (unsigned <link linkend="char">char</link> **ptr,
                                                         unsigned <link linkend="char">char</link> *end);
<link linkend="void">void</link>                <link linkend="g-string-append-u">g_string_append_u</link>                   (<link linkend="GString">GString</link> *out,
                                                         <link linkend="guint32">guint32</link> c);
<link linkend="char">char</link>*               <link linkend="camel-utf7-utf8">camel_utf7_utf8</link>                     (const <link linkend="char">char</link> *ptr);
<link linkend="char">char</link>*               <link linkend="camel-utf8-utf7">camel_utf8_utf7</link>                     (const <link linkend="char">char</link> *ptr);
<link linkend="char">char</link>*               <link linkend="camel-utf8-ucs2">camel_utf8_ucs2</link>                     (const <link linkend="char">char</link> *ptr);
<link linkend="char">char</link>*               <link linkend="camel-ucs2-utf8">camel_ucs2_utf8</link>                     (const <link linkend="char">char</link> *ptr);
</synopsis>
</refsynopsisdiv>









<refsect1 id="camel-camel-utf8.description" role="desc">
<title role="desc.title">Description</title>
<para>

</para>
</refsect1>

<refsect1 id="camel-camel-utf8.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="camel-utf8-putc" role="function">
<title>camel_utf8_putc ()</title>
<indexterm zone="camel-utf8-putc"><primary>camel_utf8_putc</primary></indexterm><programlisting><link linkend="void">void</link>                camel_utf8_putc                     (unsigned <link linkend="char">char</link> **ptr,
                                                         <link linkend="guint32">guint32</link> c);</programlisting>
<para>
Output a 32 bit unicode character as utf8 octets.  At most 4 octets will
be written to <parameter>ptr</parameter>.  <parameter>ptr</parameter> will be advanced to the next character position.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>ptr</parameter>&nbsp;:</term>
<listitem><simpara> 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>c</parameter>&nbsp;:</term>
<listitem><simpara> 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-utf8-getc" role="function">
<title>camel_utf8_getc ()</title>
<indexterm zone="camel-utf8-getc"><primary>camel_utf8_getc</primary></indexterm><programlisting><link linkend="guint32">guint32</link>             camel_utf8_getc                     (unsigned <link linkend="char">char</link> **ptr);</programlisting>
<para>
Get a Unicode character from a utf8 stream.  <parameter>ptr</parameter> will be advanced
to the next character position.  Invalid utf8 characters will be
silently skipped.  <parameter>ptr</parameter> should point to a NUL terminated array.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>ptr</parameter>&nbsp;:</term>
<listitem><simpara> 
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The next Unicode character.  <parameter>ptr</parameter> will be advanced to
the next character always.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-utf8-getc-limit" role="function">
<title>camel_utf8_getc_limit ()</title>
<indexterm zone="camel-utf8-getc-limit"><primary>camel_utf8_getc_limit</primary></indexterm><programlisting><link linkend="guint32">guint32</link>             camel_utf8_getc_limit               (unsigned <link linkend="char">char</link> **ptr,
                                                         unsigned <link linkend="char">char</link> *end);</programlisting>
<para>
Get the next utf8 char at <parameter>ptr</parameter>, and return it, advancing <parameter>ptr</parameter> to
the next character.  If <parameter>end</parameter> is reached before a full utf8
character can be read, then the invalid Unicode char 0xffff is
returned as a sentinel (Unicode 3.1, section 2.7), and <parameter>ptr</parameter> is not
advanced.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>ptr</parameter>&nbsp;:</term>
<listitem><simpara> 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&nbsp;:</term>
<listitem><simpara> must not be NULL.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The next utf8 char, or 0xffff.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-string-append-u" role="function">
<title>g_string_append_u ()</title>
<indexterm zone="g-string-append-u"><primary>g_string_append_u</primary></indexterm><programlisting><link linkend="void">void</link>                g_string_append_u                   (<link linkend="GString">GString</link> *out,
                                                         <link linkend="guint32">guint32</link> c);</programlisting>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>out</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>c</parameter>&nbsp;:</term>
<listitem><simpara>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-utf7-utf8" role="function">
<title>camel_utf7_utf8 ()</title>
<indexterm zone="camel-utf7-utf8"><primary>camel_utf7_utf8</primary></indexterm><programlisting><link linkend="char">char</link>*               camel_utf7_utf8                     (const <link linkend="char">char</link> *ptr);</programlisting>
<para>
Convert a modified utf7 string to utf8.  If the utf7 string
contains 8 bit characters, they are treated as iso-8859-1.
</para>
<para>
The IMAP rules [rfc2060] are used in the utf7 encoding.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>ptr</parameter>&nbsp;:</term>
<listitem><simpara> 
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The converted string.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-utf8-utf7" role="function">
<title>camel_utf8_utf7 ()</title>
<indexterm zone="camel-utf8-utf7"><primary>camel_utf8_utf7</primary></indexterm><programlisting><link linkend="char">char</link>*               camel_utf8_utf7                     (const <link linkend="char">char</link> *ptr);</programlisting>
<para>
Convert a utf8 string to a modified utf7 format.
</para>
<para>
The IMAP rules [rfc2060] are used in the utf7 encoding.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>ptr</parameter>&nbsp;:</term>
<listitem><simpara> 
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-utf8-ucs2" role="function">
<title>camel_utf8_ucs2 ()</title>
<indexterm zone="camel-utf8-ucs2"><primary>camel_utf8_ucs2</primary></indexterm><programlisting><link linkend="char">char</link>*               camel_utf8_ucs2                     (const <link linkend="char">char</link> *ptr);</programlisting>
<para>
Convert a utf8 string into a ucs2 one.  The ucs string will be in
network byte order, and terminated with a 16 bit NULL.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>ptr</parameter>&nbsp;:</term>
<listitem><simpara> 
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-ucs2-utf8" role="function">
<title>camel_ucs2_utf8 ()</title>
<indexterm zone="camel-ucs2-utf8"><primary>camel_ucs2_utf8</primary></indexterm><programlisting><link linkend="char">char</link>*               camel_ucs2_utf8                     (const <link linkend="char">char</link> *ptr);</programlisting>
<para>
Convert a ucs2 string into a utf8 one.  The ucs2 string is treated
as network byte ordered, and terminated with a 16 bit NUL.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>ptr</parameter>&nbsp;:</term>
<listitem><simpara> 
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> 
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
