-rw-r--r-- | kaddressbook/xxport/csv_xxport.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kaddressbook/xxport/csv_xxport.cpp b/kaddressbook/xxport/csv_xxport.cpp index 81148d9..7281003 100644 --- a/kaddressbook/xxport/csv_xxport.cpp +++ b/kaddressbook/xxport/csv_xxport.cpp @@ -30,8 +30,9 @@ $Id$ #include <qfile.h> #include <qregexp.h> #include <qtextstream.h> +#include <qtextcodec.h> #include <kfiledialog.h> #ifndef KAB_EMBEDDED #include <kio/netaccess.h> @@ -150,8 +151,9 @@ KABC::AddresseeList CSVXXPort::importContacts( const QString& ) const void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) { QTextStream t( fp ); + t.setCodec( QTextCodec::codecForName("utf8") ); KABC::AddresseeList::ConstIterator iter; KABC::Field::List fields = addressBook()->fields(); KABC::Field::List::Iterator fieldIter; @@ -176,9 +178,9 @@ void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) for ( fieldIter = fields.begin(); fieldIter != fields.end(); ++fieldIter ) { if ( !first ) t << ","; - t << "\"" << (*fieldIter)->value( addr ).replace( QRegExp("\n"), "\\n" ) << "\""; + t << "\"" << (*fieldIter)->value( addr ) << "\""; first = false; } t << "\n"; |