It's the first time I ask the question here. In fact, I don't know where
should I ask this question. If it's the wrong place, I'm so sorry......

I want to convert a GBK encoding string to UTF8, and I found that there
were some utility codes in mozilla source tree to convert a string's
encoding style. And I think the nsUTF8ConverterService class may help me.

the following is my code:
----------------------------------------------------------
//SrcString is encoded in GBK.
nsAutoString convString;
nsUTF8ConverterService converter;
PRInt32 result = converter.ConvertStringToUTF8(SrcString, "GBK",
PR_FALSE, convString);

NS_ASSERTION(result == 0, "GBK to UTF8 convert failed!");
----------------------------------------------------------

but it do not work.....

any help? thanks!
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to