diff --git a/libwccl/values/strset.cpp b/libwccl/values/strset.cpp
index e3c6999674df70901e7dca2cbd2ca443783971c8..9c869ef90978e00a0ee6c3c6455473f3e7fe3510 100644
--- a/libwccl/values/strset.cpp
+++ b/libwccl/values/strset.cpp
@@ -2,7 +2,7 @@
 #include <libpwrutils/foreach.h>
 #include <libpwrutils/util.h>
 #include <sstream>
-
+#include <boost/algorithm/string.hpp>
 
 namespace Wccl {
 
@@ -14,7 +14,12 @@ std::string StrSet::to_raw_string() const
 	ss << "[";
 	value_type::const_iterator it = set_.begin();
 	while(it != set_.end()) {
-		ss << '\"' << PwrNlp::to_utf8(*it) << '\"'; //TODO escaping
+		ss << '\"';
+		std::string item = PwrNlp::to_utf8(*it);
+		boost::algorithm::replace_all(item, "\\", "\\\\");
+		boost::algorithm::replace_all(item, "\"", "\\\"");
+		ss << item;
+		ss << '\"';
 		if(++it != set_.end()) {
 			ss << ", ";
 		}
@@ -30,7 +35,10 @@ UnicodeString StrSet::to_raw_string_u() const
 	value_type::const_iterator it = set_.begin();
 	while(it != set_.end()) {
 		u.append(UNICODE_STRING("\"", 1));
-		u.append(*it); //TODO escaping
+		UnicodeString item = *it;
+		item.findAndReplace(UNICODE_STRING("\\", 1), UNICODE_STRING("\\\\", 2));
+		item.findAndReplace(UNICODE_STRING("\"", 1), UNICODE_STRING("\\\"", 2));
+		u.append(item);
 		u.append(UNICODE_STRING("\"", 1));
 		if(++it != set_.end()) {
 			u.append(UNICODE_STRING(", ", 2));