]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/textwriter.cpp
Fix binary format
[libs/datafile.git] / source / textwriter.cpp
index 68111c0d3038c9b6b4b0f1f0a70df6b436d0c167..def744c33b06ff945c4cfccbe28025bb43402872 100644 (file)
@@ -5,6 +5,7 @@ Copyright © 2006  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
+#include <msp/strings/utils.h>
 #include "statement.h"
 #include "textwriter.h"
 
@@ -31,7 +32,7 @@ void TextWriter::write_(const Statement &st, unsigned level)
        {
                out<<' ';
                if(i->get_type()==STRING)
-                       out<<'\"'<<i->get_raw()<<'\"';
+                       out<<'\"'<<c_escape(i->get_raw(), false)<<'\"';
                else if(i->get_type()==BOOLEAN)
                        out<<(i->get<bool>() ? "true" : "false");
                else