Fw: Re: how to convert chinsese-character to utf8?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I use g_convert(string, -1, "UTF-8", "CP950", NULL, NULL, &error) to convert but get the message:
Conversion from character set 'CP950' to 'UTF-8' is not supported.


************下面是转发邮件************
原邮件发件人名字: James M. Cape
原邮件发件人地址:jcape@xxxxxxxxxxxxxx

>On Wed, 2003-09-24 at 02:51, yangxiaoli wrote:
>> I use function g_locale_to_utf8() and g_convert() to convert Chinese-character to utf8,but got error message: Invalid byte sequence in conversion input. How to convert it to utf8?
>
>You should call g_convert, with the src_encoding properly set to the
>same type as the chinese character to convert.
>
>Known chinese encodings are:
>(Simplified):
>EUC-CN, GBK, GB18030, ISO-2022-CN
>(Traditional):
>BIG5, BIG5HKSCS, EUC-TW
>
>So, if the character is encoded in BIG5, the proper call is:
>
>gchar* dest = g_convert (big5_str, -1, "BIG5", "UTF-8", NULL, NULL,
>NULL);
>
>If the source string is in another encoding, then you can replace "BIG5"
>with the other encoding's name.
>
>(the last 3 arguments are for bytes_read, bytes_written, and an optional
>error-code/msg return.)
>
>--
>Peace,
>
>    Jim Cape
>    http://ignore-your.tv
>
>    "It is literally true that, like Christianity, Socialism
>     has conquered the world by defeating itself."
>        -- Alexander Berkman, ABC of Anarchism

= = = = = = = = = = = = = = = = = = = =

========================= 				
yangxiaoli
alula@xxxxxxxxxx
2003-09-25

Attachment: signature.asc
Description: Binary data


[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux