Mercurial > pidgin.yaz
comparison libpurple/protocols/oscar/family_icbm.c @ 27805:80d3f4ff1cae
- fixed the offset of encoding field in ODC frame to be sent to peer.
- added sanitize_utf8() to purple_plugin_oscar_convert_to_utf8() as nosuke pointed it out.
- altered encoding candidates in purple_plugin_oscar_decode_im_part() to handle UTF-8 properly.
- now direct IM with multi-byte characters works correctly.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Thu, 20 Mar 2008 11:48:40 +0000 |
parents | 8dfe3a985fc1 |
children | eeee264cd325 |
comparison
equal
deleted
inserted
replaced
27804:d44a96d49ee5 | 27805:80d3f4ff1cae |
---|---|
510 byte_stream_putraw(&hdrbs, cookie, sizeof(cookie)); /* I think... */ | 510 byte_stream_putraw(&hdrbs, cookie, sizeof(cookie)); /* I think... */ |
511 byte_stream_putcaps(&hdrbs, OSCAR_CAPABILITY_CHAT); | 511 byte_stream_putcaps(&hdrbs, OSCAR_CAPABILITY_CHAT); |
512 #endif | 512 #endif |
513 //yaz | 513 //yaz |
514 // convert msg to ascii first. if it succeed, send as plain ascii. | 514 // convert msg to ascii first. if it succeed, send as plain ascii. |
515 // if it fails, convert msg into ucs-2be, and send it. | 515 // if it fails, convert msg into UTF-16BE, and send it. |
516 ucs = g_convert(msg, strlen(msg), "ASCII", "UTF-8", NULL, &bytes, NULL); | 516 ucs = g_convert(msg, strlen(msg), "ASCII", "UTF-8", NULL, &bytes, NULL); |
517 if(ucs){ | 517 if(ucs){ |
518 byte_stream_new(&hdrbs, 2+8+16+6+4+4+strlen(msg)+4+2+1+strlen(roomname)+2); | 518 byte_stream_new(&hdrbs, 2+8+16+6+4+4+strlen(msg)+4+2+1+strlen(roomname)+2); |
519 | 519 |
520 byte_stream_put16(&hdrbs, 0x0000); /* Unknown! */ | 520 byte_stream_put16(&hdrbs, 0x0000); /* Unknown! */ |