Hello.

Yesterday I upgraded my licq from 1.2.0 to 1.2.6 and faced a bug.
When I am sending a russan message to a person on my contact list, direct 
connect fails and licq tries to send through server, russian text becomes 
broken (replaced by question marks).
This happens with qt-gui, compiled with kde support.
This bug was not there in 1.2.0

I tried to hack a little and found the following.
When direct send fails, UserSendCommon::RetrySend() from 
qt-gui/src/usereventdlg.cpp is called.
It contains the following line:
   char *tmp = gTranslator.NToRN(codec->fromUnicode(ue->Message()))
Seems that it assimes ue->Message() is in unicode. But gdb shows it is not.

Attached patch fixed the problem for me (it fixes the mentioned line and 
also same situation several lines below). I don't know if this is correct, 
but it works...

P.S.
Please CC: [EMAIL PROTECTED] on reply. I am not on the list.
diff -ur licq-1.2.6.orig/plugins/qt-gui/src/usereventdlg.cpp licq-1.2.6/plugins/qt-gui/src/usereventdlg.cpp
--- licq-1.2.6.orig/plugins/qt-gui/src/usereventdlg.cpp	Sun Mar 23 20:49:39 2003
+++ licq-1.2.6/plugins/qt-gui/src/usereventdlg.cpp	Thu Mar 27 13:50:41 2003
@@ -1390,7 +1390,7 @@
     {
       CEventMsg *ue = (CEventMsg *)e->UserEvent();
       // create initial strings (implicit copying, no allocation impact :)
-      char *tmp = gTranslator.NToRN(codec->fromUnicode(ue->Message()));
+      char *tmp = gTranslator.NToRN(ue->Message());
       QCString wholeMessageRaw(tmp);
       delete [] tmp;
       unsigned int wholeMessagePos = 0;
@@ -1439,8 +1439,8 @@
         }
         else
         {
-          message = ue->Message();
-          messageRaw = codec->fromUnicode(message);
+          messageRaw = wholeMessageRaw;
+          message = codec->toUnicode(wholeMessageRaw);
         }
 
         icqEventTag = server->icqSendMessage(m_nUin, messageRaw.data(),

Reply via email to