Bug 445562

Summary: long subject line in UTF-8 is decoded incorrectly
Product: [Applications] kmail2 Reporter: Igor Zhuravlov <zhuravlov.ip>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: minor    
Priority: NOR    
Version: 5.14.2   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Igor Zhuravlov 2021-11-16 00:37:35 UTC
SUMMARY
***
When message's subject is:
1) in UTF-8,
2) encoded by Base64 as multi-line,
3) has a character which codepoint is splitted among lines,-
then this character is decoded incorrectly.
***

STEPS TO REPRODUCE
1. Receive a message with subject e.g.

Кассовый чек от ФГАОУВО "ДВФУ" за 16.11.2021

which is encoded as:

Subject: =?utf-8?B?0JrQsNGB0YHQvtCy0YvQuSDRh9C10Log0L7RgiDQpNCT0JDQ?=
 =?utf-8?B?ntCj0JLQniAi0JTQktCk0KMiINC30LAgMTYuMTEuMjAyMQ==?=

2. View this message in message list

OBSERVED RESULT
Subject is displayed as:
Кассовый чек от ФГА��УВО "ДВФУ" за 16.11.2021

EXPECTED RESULT
Subject should be displayed as:
Кассовый чек от ФГАОУВО "ДВФУ" за 16.11.2021

SOFTWARE/OS VERSIONS
Linux: 5.3.18-lp152.98-default , x86_64
KDE Plasma Version:  5.18.6
KDE Frameworks Version: 5.71.0
Qt Version: 5.12.7 (built with version 5.12.7)

ADDITIONAL INFORMATION
If message is composed in KMail2 itself, then its subject is single-lined:

Subject: =?UTF-8?B?0JrQsNGB0YHQvtCy0YvQuSDRh9C10Log0L7RgiDQpNCT0JDQntCj0JLQniAi0JTQktCk0KMiINC30LA=?= 16.11.2021

and this problem doesn't appear.