-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 @@ -26,16 +26,17 @@ Enhanced Version of the file for platform independent KDE tools. Copyright (c) 2004 Ulf Schenk $Id$ */ #include <qfile.h> #include <qregexp.h> #include <qtextstream.h> +#include <qtextcodec.h> #include <kfiledialog.h> #ifndef KAB_EMBEDDED #include <kio/netaccess.h> #endif //KAB_EMBEDDED #include <klocale.h> #include <kmessagebox.h> @@ -146,16 +147,17 @@ KABC::AddresseeList CSVXXPort::importContacts( const QString& ) const return dlg.contacts(); else return KABC::AddresseeList(); } 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; bool first = true; // First output the column headings for ( fieldIter = fields.begin(); fieldIter != fields.end(); ++fieldIter ) { @@ -172,17 +174,17 @@ void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) for ( iter = list.begin(); iter != list.end(); ++iter ) { addr = *iter; first = true; 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"; } } #ifndef KAB_EMBEDDED |