Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

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.

Parameters:
a_in the input string to convert.
a_in_len in/out parameter. The length of the input string. After return, points to the actual number of characters consumed. This can be usefull to debug the input string in case of encoding error.
a_out out parameter. Points to the output string. It is allocated by this function and must be freed by the caller.
a_out_len out parameter. The length (in bytes) of the output string.
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 848 of file cr-utils.c.

References cr_utils_ucs4_str_len_as_utf8(), and cr_utils_ucs4_to_utf8().

{
        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;
}


Generated by  Doxygen 1.6.0   Back to index