powered by Jive Software

How can I transmit chinese words to the wildfire server?

Hello,

I am using vc++ to make an IM client. My partner use smack to make another IM client. When I send some chinese words to him by socket, he get the “???”.

My partner try to convert what he get by :

System.out.println(“unicode:”+new String(packet.getBody().getBytes(“unicode”),“gb2312”));

System.out.println(“gb2312:”+new String(packet.getBody().getBytes(“gb2312”),“gb2312”));

System.out.println(“ISO8859-1:”+new String(packet.getBody().getBytes(“iso-8859-1”),“gb2312”));

But all that failed !!

So,what should i do?

Hi,

I think he wants to decode the packets as UTF-8 and not as unicode.

May I ask if “жйЧрёТРдАθΝн&#1099 ;” is simplified chinese, it looks more like Cyrillic to me? With Spark I have no problems to transfer this text, maybe you also have not a transfer but a display problem. Does the font you did select support chinese?

Do you have these problems also with Spark?

Using Smack you could use “XMPPConnection.DEBUG_ENABLED = true;” to display the received packets.

LG

hey handsomeli

above boy’‘s answer is right explain to wildfile’'s messenge package format,it is use UTF-8 decode.

-Tom

Thank you very much,I will tell my partner to try encoding with utf-8.