* [gentoo-commits] gentoo-x86 commit in kde-base/kdepimlibs/files: kdepimlibs-4.6.2-encoding.patch
@ 2011-04-18 20:09 Andreas HAttel (dilfridge)
0 siblings, 0 replies; 2+ messages in thread
From: Andreas HAttel (dilfridge) @ 2011-04-18 20:09 UTC (permalink / raw
To: gentoo-commits
dilfridge 11/04/18 20:09:33
Added: kdepimlibs-4.6.2-encoding.patch
Log:
Add upstream patch to fix encoding in e-mail headers, kde bug 263761
(Portage version: 2.1.9.46/cvs/Linux x86_64)
Revision Changes Path
1.1 kde-base/kdepimlibs/files/kdepimlibs-4.6.2-encoding.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/kdepimlibs/files/kdepimlibs-4.6.2-encoding.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/kdepimlibs/files/kdepimlibs-4.6.2-encoding.patch?rev=1.1&content-type=text/plain
Index: kdepimlibs-4.6.2-encoding.patch
===================================================================
commit 6d80788587894ee0cf3e087f959226a3d764af95
Author: Thomas McGuire <mcguire@kde.org>
Date: Sat Apr 16 21:56:01 2011 +0100
Use UTF-8 if the charset can't encode the string.
Hopefully the call to canEncode() won't affect the performance too
much...
BUG: 263761
(cherry picked from commit 7b75f8a769ef0e40e59dedb1327ff0ed51e63ba9)
diff --git a/kmime/kmime_util.cpp b/kmime/kmime_util.cpp
index 29ea676..ab1906c 100644
--- a/kmime/kmime_util.cpp
+++ b/kmime/kmime_util.cpp
@@ -287,6 +287,11 @@ QByteArray encodeRFC2047String( const QString &src, const QByteArray &charset,
usedCS = charset;
}
+ if ( !codec->canEncode( src ) ) {
+ usedCS = "utf-8";
+ codec = QTextCodec::codecForName( usedCS );
+ }
+
if ( usedCS.contains( "8859-" ) ) { // use "B"-Encoding for non iso-8859-x charsets
useQEncoding = true;
}
diff --git a/kmime/kmime_util.h b/kmime/kmime_util.h
index 84c061e..ebe2a38 100644
--- a/kmime/kmime_util.h
+++ b/kmime/kmime_util.h
@@ -165,7 +165,7 @@ KMIME_EXPORT extern QString decodeRFC2047String( const QByteArray &src );
Encodes string @p src according to RFC2047 using charset @p charset.
@param src source string.
- @param charset charset to use.
+ @param charset charset to use. If it can't encode the string, UTF-8 will be used instead.
@param addressHeader if this flag is true, all special chars
like <,>,[,],... will be encoded, too.
@param allow8bitHeaders if this flag is true, 8Bit headers are allowed.
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] gentoo-x86 commit in kde-base/kdepimlibs/files: kdepimlibs-4.6.2-encoding.patch
@ 2011-12-12 1:09 Jonathan Callen (abcd)
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Callen (abcd) @ 2011-12-12 1:09 UTC (permalink / raw
To: gentoo-commits
abcd 11/12/12 01:09:42
Removed: kdepimlibs-4.6.2-encoding.patch
Log:
rm old files
(Portage version: 2.2.0_alpha80/cvs/Linux x86_64)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-12 1:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-12 1:09 [gentoo-commits] gentoo-x86 commit in kde-base/kdepimlibs/files: kdepimlibs-4.6.2-encoding.patch Jonathan Callen (abcd)
-- strict thread matches above, loose matches on Subject: below --
2011-04-18 20:09 Andreas HAttel (dilfridge)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox