kmail

stringutil.cpp
1 /* Copyright 2009 Thomas McGuire <mcguire@kde.org>
2 
3  This program is free software; you can redistribute it and/or
4  modify it under the terms of the GNU General Public License as
5  published by the Free Software Foundation; either version 2 of
6  the License or (at your option) version 3 or any later version
7  accepted by the membership of KDE e.V. (or its successor approved
8  by the membership of KDE e.V.), which shall act as a proxy
9  defined in Section 14 of version 3 of the license.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 #include "stringutil.h"
20 #include "kmmsgbase.h"
21 #include <kurl.h>
22 
23 namespace KMail
24 {
25 
26 namespace StringUtil
27 {
28 #ifndef KMAIL_UNITTESTS
29 TQString encodeMailtoUrl( const TQString& str )
30 {
31  TQString result;
32  result = TQString::fromLatin1( KMMsgBase::encodeRFC2047String( str,
33  "utf-8" ) );
34  result = KURL::encode_string( result );
35  return result;
36 }
37 
38 TQString decodeMailtoUrl( const TQString& url )
39 {
40  TQString result;
41  result = KURL::decode_string( url.latin1() );
42  result = KMMsgBase::decodeRFC2047String( result.latin1() );
43  return result;
44 }
45 #endif
46 
47 }
48 
49 }
TQString decodeMailtoUrl(const TQString &url)
Decodes a mailto URL.
Definition: stringutil.cpp:38
TQString encodeMailtoUrl(const TQString &str)
Encodes an email address as mailto URL.
Definition: stringutil.cpp:29
folderdiaquotatab.h
Definition: aboutdata.cpp:40