aboutsummaryrefslogtreecommitdiff
path: root/src/csvwriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/csvwriter.cpp')
-rw-r--r--src/csvwriter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/csvwriter.cpp b/src/csvwriter.cpp
index 58437b8..d8910aa 100644
--- a/src/csvwriter.cpp
+++ b/src/csvwriter.cpp
@@ -50,7 +50,7 @@ void Bu::CsvWriter::writeLine( const StrArray &aStrs )
50 50
51Bu::String Bu::CsvWriter::encodeExcel( const Bu::String &sIn ) 51Bu::String Bu::CsvWriter::encodeExcel( const Bu::String &sIn )
52{ 52{
53 if( sIn.find('\"') ) 53 if( sIn.find('\"') || sIn.find(',') )
54 { 54 {
55 Bu::String sOut = "\""; 55 Bu::String sOut = "\"";
56 for( Bu::String::const_iterator i = sIn.begin(); i; i++ ) 56 for( Bu::String::const_iterator i = sIn.begin(); i; i++ )
@@ -60,6 +60,7 @@ Bu::String Bu::CsvWriter::encodeExcel( const Bu::String &sIn )
60 else 60 else
61 sOut += *i; 61 sOut += *i;
62 } 62 }
63 sOut += '\"';
63 return sOut; 64 return sOut;
64 } 65 }
65 return sIn; 66 return sIn;