summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/generatemail.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/libmailwrapper/generatemail.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/generatemail.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/kmicromail/libmailwrapper/generatemail.cpp b/kmicromail/libmailwrapper/generatemail.cpp
index 49315ba..32311d7 100644
--- a/kmicromail/libmailwrapper/generatemail.cpp
+++ b/kmicromail/libmailwrapper/generatemail.cpp
@@ -9,7 +9,7 @@
#include <qfileinfo.h>
using namespace Opie::Core;
-const char* Generatemail::USER_AGENT="OpieMail v0.6";
+const char* Generatemail::USER_AGENT="KOpieMail 33 1/3";
Generatemail::Generatemail()
{
@@ -132,7 +132,6 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet
char*name = 0;
char*file = 0;
int err;
-
int pos = filename.findRev( '/' );
if (filename.length()>0) {
@@ -171,7 +170,7 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet
if (filename.length()>0) {
err = mailmime_set_body_file( filePart, file );
} else {
- err = mailmime_set_body_text(filePart,strdup(TextContent.data()),TextContent.length());
+ err = mailmime_set_body_text(filePart,strdup( TextContent.utf8()),TextContent.utf8().length());
}
if (err != MAILIMF_NO_ERROR) {
qDebug("Error setting body with file ");
@@ -227,7 +226,7 @@ mailmime *Generatemail::buildTxtPart(const QString&str ) {
mailmime_content *content;
mailmime_parameter *param;
int err;
-
+ QCString __str;
param = mailmime_parameter_new( strdup( "charset" ),
strdup( "iso-8859-1" ) );
if ( param == NULL )
@@ -248,8 +247,10 @@ mailmime *Generatemail::buildTxtPart(const QString&str ) {
txtPart = mailmime_new_empty( content, fields );
if ( txtPart == NULL )
goto err_free_fields;
-
- err = mailmime_set_body_text( txtPart, (char*)str.data(), str.length() );
+ {
+ __str = str.utf8();
+ err = mailmime_set_body_text( txtPart, __str.data(), __str.length() );
+ }
if ( err != MAILIMF_NO_ERROR )
goto err_free_txtPart;