Bug 269463 - OTR auth request with bad charset
Summary: OTR auth request with bad charset
Status: CONFIRMED
Alias: None
Product: kopete
Classification: Applications
Component: OTR Plugin (show other bugs)
Version: unspecified
Platform: Exherbo Linux
: NOR minor
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-26 14:01 UTC by Morten Sjoegren
Modified: 2016-11-27 15:46 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch for otrlchatinterface.cpp (644 bytes, patch)
2011-04-10 13:17 UTC, Anton Revunov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Morten Sjoegren 2011-03-26 14:01:12 UTC
Version:           unspecified (using KDE 4.6.1) 
OS:                Linux

A friend of mine sent me the following OTR auth question:
"Hvad hed den vej du boede på som lille?"

The string was displayed as:
"Hvad hed den vej du boede på som lille?"
(Notice that "å" became "Ã¥")

My friend is using pidgin on a Danish Windows7 and we chat over MSN.

It looks like a typical charset problem but I don't know if it's other client (pidgin) that's using the wrong charset or if it's kopete.

Reproducible: Didn't try
Comment 1 Anton Revunov 2011-04-10 13:17:55 UTC
Created attachment 58763 [details]
Patch for otrlchatinterface.cpp

It works for me.
Comment 2 Pali Rohár 2014-06-25 10:38:51 UTC
OTR plugin was updated in Kopete. Can you check if there is still this problem?
Comment 3 Anton Revunov 2014-06-25 10:47:57 UTC
I checked it right now. Still there on 

Ubuntu 14.04

Kopete
Version 1.6.60
Using KDE Development Platform 4.13.2

OTR
Version 0.10
Using KDE Development Platform 4.13.2
Comment 4 Pali Rohár 2014-06-25 11:11:50 UTC
@Michael Zanetti: Please can you look at this bug? I looked into source code of OTR plugin and there is mix of Latin1 and UTF8 encodings. So I think that this is reason. Does OTR specify encoding of messages?
Comment 5 Michael Zanetti 2014-06-25 14:43:10 UTC
@Pali: ok. I'll try to find some time to look into this one. The reason why there's a mix between utf8 and latin1 is that OTR doesn't really specify it, and thus the various clients behave differently. The current situation is the result of an endless trial and error with many different other clients talking to Kopete. However, given that it has been quite a while ago, the situation might have changed.
Comment 6 Pali Rohár 2016-11-27 15:46:21 UTC
I think we should use UTF-8 on all places.

Kopete::Message store message body in QString which is Unicode. Kopete plugins should access messages in UTF-8 and if some Kopete protocol use different encoding it should encode/decode Kopete::Messages itself in protocol code.

If OTR layer does not specify in which encoding should be messages we have two options:

1) Allow user to configure encoding per contact (like ICQ protocol for ICQ contacts)

2) Use UTF-8 which is widely used on lot of places

3) For incoming messages try UTF-8 decoder and if fails then fallback to Latin1

But I really suggest to use UTF-8 for both encoding and decoding.