--- a/src/AwkHandler.h Fri May 10 00:45:37 2019 +0200
+++ b/src/AwkHandler.h Sat May 11 22:47:49 2019 +0200
@@ -152,8 +152,14 @@
}
string_t escapeAwkValue(const string_t& value) {
- // FIXME: escape field and record separators
- return value;
+ std::wstringstream escaped;
+ for (wchar_t ch : value) {
+ if (ch == '\t') escaped << L"\\t";
+ else if (ch == '\n') escaped << L"\\n";
+ else if (ch == '\\') escaped << L"\\\\";
+ else escaped << ch;
+ }
+ return escaped.str();
}
void processAwkOutput(int awkOutputReaderFD) {