<refentry id="gmime-gmime-iconv-utils">
<refmeta>
<refentrytitle role="top_of_page" id="gmime-gmime-iconv-utils.top_of_page">gmime-iconv-utils</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  GMIME Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>gmime-iconv-utils</refname>
<refpurpose>High-level routines for converting text from one charset to another</refpurpose>
</refnamediv>

<refsynopsisdiv id="gmime-gmime-iconv-utils.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis><link linkend="char"><returnvalue>char</returnvalue></link> *              <link linkend="g-mime-iconv-strdup">g_mime_iconv_strdup</link>                 (<parameter><link linkend="iconv-t"><type>iconv_t</type></link> cd</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);
<link linkend="char"><returnvalue>char</returnvalue></link> *              <link linkend="g-mime-iconv-strndup">g_mime_iconv_strndup</link>                (<parameter><link linkend="iconv-t"><type>iconv_t</type></link> cd</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *str</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> n</parameter>);
<link linkend="char"><returnvalue>char</returnvalue></link> *              <link linkend="g-mime-iconv-utf8-to-locale">g_mime_iconv_utf8_to_locale</link>         (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);
<link linkend="char"><returnvalue>char</returnvalue></link> *              <link linkend="g-mime-iconv-utf8-to-locale-length">g_mime_iconv_utf8_to_locale_length</link>  (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> n</parameter>);
<link linkend="char"><returnvalue>char</returnvalue></link> *              <link linkend="g-mime-iconv-locale-to-utf8">g_mime_iconv_locale_to_utf8</link>         (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);
<link linkend="char"><returnvalue>char</returnvalue></link> *              <link linkend="g-mime-iconv-locale-to-utf8-length">g_mime_iconv_locale_to_utf8_length</link>  (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> n</parameter>);
</synopsis>
</refsynopsisdiv>

<refsect1 id="gmime-gmime-iconv-utils.description" role="desc">
<title role="desc.title">Description</title>
<para>
Charset conversion utility functions.
</para>
</refsect1>
<refsect1 id="gmime-gmime-iconv-utils.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="g-mime-iconv-strdup" role="function">
<title>g_mime_iconv_strdup ()</title>
<indexterm zone="g-mime-iconv-strdup"><primary>g_mime_iconv_strdup</primary></indexterm>
<programlisting><link linkend="char"><returnvalue>char</returnvalue></link> *              g_mime_iconv_strdup                 (<parameter><link linkend="iconv-t"><type>iconv_t</type></link> cd</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);</programlisting>
<para>
Allocates a new string buffer containing <parameter>str</parameter> converted to the
destination charset described in <parameter>cd</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>cd</parameter>&#160;:</term>
<listitem><simpara>conversion descriptor
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>str</parameter>&#160;:</term>
<listitem><simpara>string in source charset
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new string buffer containing the original string
converted to the new charset.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-iconv-strndup" role="function">
<title>g_mime_iconv_strndup ()</title>
<indexterm zone="g-mime-iconv-strndup"><primary>g_mime_iconv_strndup</primary></indexterm>
<programlisting><link linkend="char"><returnvalue>char</returnvalue></link> *              g_mime_iconv_strndup                (<parameter><link linkend="iconv-t"><type>iconv_t</type></link> cd</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *str</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> n</parameter>);</programlisting>
<para>
Allocates a new string buffer containing the first <parameter>n</parameter> bytes of <parameter>str</parameter>
converted to the destination charset as described by the conversion
descriptor <parameter>cd</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>cd</parameter>&#160;:</term>
<listitem><simpara>conversion descriptor
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>str</parameter>&#160;:</term>
<listitem><simpara>string in source charset
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n</parameter>&#160;:</term>
<listitem><simpara>number of bytes to convert
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new string buffer containing the first <parameter>n</parameter> bytes of
<parameter>str</parameter> converted to the destination charset as described by the
conversion descriptor <parameter>cd</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-iconv-utf8-to-locale" role="function">
<title>g_mime_iconv_utf8_to_locale ()</title>
<indexterm zone="g-mime-iconv-utf8-to-locale"><primary>g_mime_iconv_utf8_to_locale</primary></indexterm>
<programlisting><link linkend="char"><returnvalue>char</returnvalue></link> *              g_mime_iconv_utf8_to_locale         (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);</programlisting>
<para>
Allocates a new string buffer containing <parameter>str</parameter> converted to the
user's locale charset.
</para><variablelist role="params">
<varlistentry><term><parameter>str</parameter>&#160;:</term>
<listitem><simpara>string in UTF-8 charset
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new string buffer containing <parameter>str</parameter> converted to the
user's locale charset.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-iconv-utf8-to-locale-length" role="function">
<title>g_mime_iconv_utf8_to_locale_length ()</title>
<indexterm zone="g-mime-iconv-utf8-to-locale-length"><primary>g_mime_iconv_utf8_to_locale_length</primary></indexterm>
<programlisting><link linkend="char"><returnvalue>char</returnvalue></link> *              g_mime_iconv_utf8_to_locale_length  (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> n</parameter>);</programlisting>
<para>
Allocates a new string buffer containing the first <parameter>n</parameter> bytes of
<parameter>str</parameter> converted to the user's locale charset.
</para><variablelist role="params">
<varlistentry><term><parameter>str</parameter>&#160;:</term>
<listitem><simpara>string in UTF-8 charset
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n</parameter>&#160;:</term>
<listitem><simpara>number of bytes to convert
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new string buffer containing the first <parameter>n</parameter> bytes of
<parameter>str</parameter> converted to the user's locale charset.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-iconv-locale-to-utf8" role="function">
<title>g_mime_iconv_locale_to_utf8 ()</title>
<indexterm zone="g-mime-iconv-locale-to-utf8"><primary>g_mime_iconv_locale_to_utf8</primary></indexterm>
<programlisting><link linkend="char"><returnvalue>char</returnvalue></link> *              g_mime_iconv_locale_to_utf8         (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);</programlisting>
<para>
Allocates a new string buffer containing <parameter>str</parameter> in UTF-8.
</para><variablelist role="params">
<varlistentry><term><parameter>str</parameter>&#160;:</term>
<listitem><simpara>string in locale charset
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new string buffer containing <parameter>str</parameter> converted to UTF-8.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-iconv-locale-to-utf8-length" role="function">
<title>g_mime_iconv_locale_to_utf8_length ()</title>
<indexterm zone="g-mime-iconv-locale-to-utf8-length"><primary>g_mime_iconv_locale_to_utf8_length</primary></indexterm>
<programlisting><link linkend="char"><returnvalue>char</returnvalue></link> *              g_mime_iconv_locale_to_utf8_length  (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> n</parameter>);</programlisting>
<para>
Allocates a new string buffer containing the first <parameter>n</parameter> bytes of
<parameter>str</parameter> converted to UTF-8.
</para><variablelist role="params">
<varlistentry><term><parameter>str</parameter>&#160;:</term>
<listitem><simpara>string in locale charset
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n</parameter>&#160;:</term>
<listitem><simpara>number of bytes to convert
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new string buffer containing the first <parameter>n</parameter> bytes of
<parameter>str</parameter> converted to UTF-8.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>

</refentry>
