Skip to content

Commit 88bc1f9

Browse files
Merge pull request #1219 from LAJW/test-gen-java-escape-backslash
Escape backslash in generated tests [Hotfix]
2 parents 0cd1057 + c3e273f commit 88bc1f9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/util/unicode.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,16 @@ std::string utf16_little_endian_to_java(const std::wstring &in)
298298
result << "\\n";
299299
else if(ch=='\r')
300300
result << "\\r";
301+
else if(ch=='\f')
302+
result << "\\f";
303+
else if(ch=='\b')
304+
result << "\\b";
305+
else if(ch=='\t')
306+
result << "\\t";
301307
else if(ch<=255 && isprint(ch, loc))
302308
{
303309
const auto uch=static_cast<unsigned char>(ch);
304-
if(uch=='"')
310+
if(uch=='"' || uch=='\\')
305311
result << '\\';
306312
result << uch;
307313
}

0 commit comments

Comments
 (0)