/* Converts an ucs4 string into an utf8 string.  */
enum CRStatus cr_utils_ucs4_str_to_utf8(const guint32 *a_in, gulong *a_in_len, guchar **a_out, gulong *a_out_len)
/* Converts an ucs4 string into an utf8 string.  */
enum CRStatus cr_utils_ucs4_str_to_utf8(const guint32 *a_in, gulong *a_in_len, guchar **a_out, gulong *a_out_len)
{
        enum CRStatus status = CR_OK;
        g_return_val_if_fail (a_in && a_in_len && a_out
                              && a_out_len, CR_BAD_PARAM_ERROR);
        status = cr_utils_ucs4_str_len_as_utf8 (a_in,
                                                &a_in[*a_out_len - 1],
                                                a_out_len);
        g_return_val_if_fail (status == CR_OK, status);
        status = cr_utils_ucs4_to_utf8 (a_in, a_in_len, *a_out, a_out_len);
        return status;
}