https://winscp.net/tracker/1745 (cherry picked from commit 1beb65b22829cbd386c4d2121b4104a00a2c3bee) Source commit: 751598f8db2bcad15feca46de6db04c7c6ddd263
@@ -216,7 +216,8 @@ UnicodeString CopyToChars(const UnicodeString & Str, int & From, UnicodeString C
{
if (DoubleDelimiterEscapes &&
(P < Str.Length()) &&
- IsDelimiter(Chs, Str, P + 1))
+ IsDelimiter(Chs, Str, P + 1) &&
+ (Str[P + 1] == Str[P]))
Result += Str[P];
P++;