diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-03-11 14:45:38 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-03-11 14:45:38 (GMT) |
commit | c34e0ce034586a05308e552cbbdff48beec7dd96 (patch) | |
tree | 39c73ba64b0d228b3c53913ea4e7ab6dda6ad5c1 /src/uscxml/Message.cpp | |
parent | ca46aa711fb5d08a8fd1cc6b91593c281189e8e3 (diff) | |
download | uscxml-c34e0ce034586a05308e552cbbdff48beec7dd96.zip uscxml-c34e0ce034586a05308e552cbbdff48beec7dd96.tar.gz uscxml-c34e0ce034586a05308e552cbbdff48beec7dd96.tar.bz2 |
Integrated debugger into browser (use -d command line parameter)
Diffstat (limited to 'src/uscxml/Message.cpp')
-rw-r--r-- | src/uscxml/Message.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/uscxml/Message.cpp b/src/uscxml/Message.cpp index aeb0027..33dca84 100644 --- a/src/uscxml/Message.cpp +++ b/src/uscxml/Message.cpp @@ -430,6 +430,7 @@ Data Data::fromJSON(const std::string& jsonString) { std::string value = trimmed.substr(t[currTok].start, t[currTok].end - t[currTok].start); if (dataStack.back()->type == Data::VERBATIM) { boost::replace_all(value, "\\\"", "\""); + boost::replace_all(value, "\\n", "\n"); } dataStack.back()->atom = value; dataStack.pop_back(); @@ -728,10 +729,11 @@ std::string Data::toJSON(const Data& data) { // escape string if (false) { } else if (data.atom[i] == '"') { - os << '\\'; - os << data.atom[i]; + os << "\\\""; } else if (data.atom[i] == '\n') { os << "\\n"; + } else if (data.atom[i] == '\t') { + os << "\\t"; } else { os << data.atom[i]; } @@ -746,6 +748,7 @@ std::string Data::toJSON(const Data& data) { std::string xmlSer = xmlSerSS.str(); boost::replace_all(xmlSer, "\"", "\\\""); boost::replace_all(xmlSer, "\n", "\\n"); + boost::replace_all(xmlSer, "\t", "\\t"); os << "\"" << xmlSer << "\""; } else { if (data.type == Data::VERBATIM) { |