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

enum CRStatus cr_utils_ucs1_str_to_utf8 ( const guchar *  a_in,
gulong *  a_in_len,
guchar **  a_out,
gulong *  a_out_len 
)

Converts an ucs1 string into an utf8 string.

Parameters:
a_in_start the beginning of the input string to convert.
a_in_end the end of the input string to convert.
a_out out parameter. The converted string.
a_out out parameter. The length of the converted string.
Returns:
CR_OK upon successfull completion, an error code otherwise.

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

References cr_utils_ucs1_str_len_as_utf8(), and cr_utils_ucs1_to_utf8().

{
        gulong in_len = 0,
                out_len = 0;
        enum CRStatus status = CR_OK;

        g_return_val_if_fail (a_in && a_in_len && a_out
                              && a_out_len, CR_BAD_PARAM_ERROR);

        if (*a_in_len < 1) {
                *a_out_len = 0;
                *a_out = NULL;
                return CR_OK;
        }

        status = cr_utils_ucs1_str_len_as_utf8 (a_in, &a_in[*a_in_len - 1],
                                                &out_len);

        g_return_val_if_fail (status == CR_OK, status);

        in_len = *a_in_len;

        *a_out = (guchar *) g_malloc0 (out_len);

        status = cr_utils_ucs1_to_utf8 (a_in, a_in_len, *a_out, &out_len);

        *a_out_len = out_len;

        return status;
}


Generated by  Doxygen 1.6.0   Back to index