コード例 #1
0
ファイル: charset.c プロジェクト: Jonimoose/tilp-libticonv
/**
 * ticonv_ti89tpusb_to_utf16:
 * @ti: null terminated string (input)
 * @utf16: null terminated string (output)
 *
 * Titanium/USB charset to UTF-16 conversion.
 *
 * Return value: returns the destination pointer or NULL if error.
 **/
TIEXPORT4 unsigned short* TICALL ticonv_ti89tusb_to_utf16(const char *ti, unsigned short *utf16)
{
    unsigned short *tmp;

    tmp = ticonv_utf8_to_utf16(ti);
    memcpy(utf16, tmp, 2 * ticonv_utf16_strlen(tmp));
    g_free(tmp);

    return utf16;
}
コード例 #2
0
ファイル: charset.c プロジェクト: TC01/tilibs
static unsigned short * ticonv_usb_to_utf16(const char *ti, unsigned short *utf16)
{
	unsigned short *tmp;

	if (ti == NULL || utf16 == NULL)
	{
		return NULL;
	}

	tmp = ticonv_utf8_to_utf16(ti);
	if (tmp == NULL)
	{
		return NULL;
	}

	if (utf16 != NULL)
	{
		memcpy(utf16, tmp, 2 * ticonv_utf16_strlen(tmp));
	}
	ticonv_utf16_free(tmp);

	return utf16;
}