[Pidgin] #2712: Duplicate groups appears

Pidgin trac at pidgin.im
Sun Mar 9 11:28:37 EDT 2008


#2712: Duplicate groups appears
---------------------+------------------------------------------------------
  Reporter:  rschnz  |       Owner:  MarkDoliner
      Type:  patch   |      Status:  closed     
  Priority:  minor   |   Milestone:  2.4.1      
 Component:  ICQ     |     Version:  2.1.1      
Resolution:  fixed   |    Keywords:             
   Pending:  0       |  
---------------------+------------------------------------------------------
Comment (by linvinus):

 sorry with authorization i make mistake

 the problem

 $ env | grep LANG
 LANG=ru_RU.UTF-8
 GDM_LANG=ru_RU.UTF-8
 $ pidgin --debug
 ....
 (17:50:17) oscar: ssi: received authorization request from 294517883
 (17:50:17) oscar: Parsing IM part, charset=0x0003, charsubset=0x0000,
 datalen=54
 char set!!! charsetstr1=CP1251 charsetstr2=UTF-8
 char set2!!! CP1251  data='Пожалуйста, авторизуйте меня!' len=54
 fallback=0

 as you can see charsetstr1=CP1251 but data in utf8 (this request send
 pidgin 2.3.1 (without my patches) )
 So when called purple_plugin_oscar_convert_to_utf8() it convert data from
 urf8 to cp1251 that is wrong. That is why user see
 http://img235.imageshack.us/my.php?image=screenshotbuddylist3xy4.png

 But simple test in  purple_plugin_oscar_convert_to_utf8()
 if (g_utf8_validate(data, -1, NULL))
                 return  g_strdup(data);

 will not work if charset == UCS-2BE

 (18:01:29) oscar: Parsing IM part, charset=0x0002, charsubset=0x0000,
 datalen=24
 char set!!! charsetstr1=UCS-2BE charsetstr2=UTF-8
 (18:01:29) pidgin-libnotify: notify(), new: title: 'rotanoved says:',
 body:
 '?@>AB>',
 buddy: 'rotanoved'
 (18:01:29) pidgin-libnotify: notify(), has a prpl icon.
 (18:01:29) g_log: purple_conversation_get_ui_ops: assertion `conv != NULL'
 failed


 where '?@>AB>'
 == "просто текст"

 so this is my decision in purple_plugin_oscar_convert_to_utf8()


 -       if (g_ascii_strcasecmp("UTF-8", charsetstr)) {
 +
 +       if (g_ascii_strcasecmp("UTF-8", charsetstr)!=0 && (
 g_ascii_strcasecmp("UCS-2BE", charsetstr)==0 || !g_utf8_validate(data,
 datalen, NULL) ) ) {

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


More information about the Tracker mailing list