示例#1
0
const char *charset_from_utf8(const char *from)
{
    static char *to = NULL;

    if (to)
	free(to);

    charset_set("ISO−8859−1", "UTF-8");
    to = charset_conv_strdup(from);

    if (to == NULL)
	return from;

    return to;
}
示例#2
0
文件: charset.c 项目: 0x27/mrw-code
const char *
charset_from_utf8(const char *from) {
	static char * to = NULL;

	if (!charset_enable_output)
		/* no locale: return raw UTF-8 */
		return from;

	if(to) free(to);

	charset_set(locale_charset, "UTF-8");
	to = charset_conv_strdup(from);

	if (to == NULL)
		return from;

	return to;
}
示例#3
0
文件: charset.c 项目: 0x27/mrw-code
const char *
charset_to_utf8(const char *from) {
	static char * to = NULL;

	if (!charset_enable_input)
		/* no locale: return raw input */
		return from;

	if(to) free(to);

	charset_set("UTF-8", locale_charset);
	to = charset_conv_strdup(from);

	if (to == NULL)
		return from;

	return to;
}