[Pidgin] #10833: Offline ICQ Messages Sent with Wrong Encoding

Pidgin trac at pidgin.im
Sat Feb 6 20:58:51 EST 2010


#10833: Offline ICQ Messages Sent with Wrong Encoding
--------------------+-------------------------------------------------------
 Reporter:  assen   |        Owner:  MarkDoliner
     Type:  defect  |       Status:  new        
Milestone:          |    Component:  ICQ        
  Version:  2.6.3   |   Resolution:             
 Keywords:          |  
--------------------+-------------------------------------------------------

Comment(by darkrain42):

 It looks like this is being caused by
 `purple_plugin_oscar_convert_to_best_encoding`.  In particular, it works
 for online messages likely because of this note:
 {{{
     /*
      * If we're sending to an ICQ user, and they are in our
      * buddy list, and they are advertising the Unicode
      * capability, and they are online, then attempt to send
      * as UTF-16BE.
      */
 }}}

 When the buddy is offline, my guess is that the following code is encoding
 to UTF-8, but the charset is stuck as LATIN_1, which seems wrong.  I'm not
 familiar with the OSCAR prpls, so I'm not positive what should be
 happening here:
 {{{
     /*
      * If this is AIM then attempt to send as ISO-8859-1.  If this is
      * ICQ then attempt to send as the user specified character encoding.
      */
     charsetstr = "ISO-8859-1";
     if ((destbn != NULL) && oscar_util_valid_name_icq(destbn))
         charsetstr = purple_account_get_string(account, "encoding",
 OSCAR_DEFAULT_CUSTOM_ENCODING);

     /*
      * XXX - We need a way to only attempt to convert if we KNOW "from"
      * can be converted to "charsetstr"
      */
     *msg = g_convert(from, -1, charsetstr, "UTF-8", NULL, &msglen, &err);
     if (*msg != NULL) {
         *charset = AIM_CHARSET_LATIN_1;
         *charsubset = 0x0000;
         *msglen_int = msglen;
         return;
     }
 }}}

 You'd probably have better luck if you set the encoding value to UTF-16BE
 (which is more or less what is used for sending unicode messages),
 although I wonder how ICQ clients do/[are supposed to] interpret the
 charset value.

-- 
Ticket URL: <http://developer.pidgin.im/ticket/10833#comment:1>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list