[JDEV] Non english messages solution?
Alex She<Wizdomtech - Analyst Programmer>
alexshe at wizdomtech.com
Tue Sep 25 20:30:34 CDT 2001
> Which im client? I am using winjabber.One OS is w2k(GBK), the other
> is win98(big5).
> I sent message to another, got many "?".
I wrote a im client for Pockect pc , use embeded vc 3.00 by myself.
I experienced such things, so many "?"[0x3f],just for wrong convert libary,
if you need more help, I need more detail,
> UTF8 byte stream --> unicode --> native byte stream
> UTF8 byte stream --> native byte stream
> which is right above?
All is right, first is easy and direct, second,, em, I don't howto if not
throught unicode ,
> I have test the first using java.The unicode I got is right.But native
> byte stream is wrong.
> byte utf8;
> String unicodeString = new String(utf8, "utf8");
get UTF8 string if right;
> byte gbk = unicodeString.getBytes("BGK");
I don't think this is ok, but not sure , you can test it by print the string
hex code, never use getBytes, getChars instead.
Just try byte native = instreamStr.getBytes();// to native
> >BTW , what parser you use in client end? expat? if not , you may look
> at your
> >client parser.
> winjabber uses jabberCOM.
jabberCom is use expat parser, which use UTF8, so everything is easy ,
you used vc for client , all you need to do is:
UTF8 byte stream --> unicode --> native byte stream.
have you used A2W or W2A ATL function? these product "?".
This mail sent through IMP: mail.wizdomtech.com
More information about the JDev