fix: handle escaped underscore \_ correctly

This commit is contained in:
Simon Gene Gottlieb
2026-02-17 22:14:55 +01:00
committed by Jesse Beder
parent 3e53605a31
commit 44d54544b1

View File

@@ -117,11 +117,11 @@ std::string Escape(Stream& in) {
case 'N': case 'N':
return "\x85"; return "\x85";
case '_': case '_':
return "\xA0"; return "\xC2\xA0"; // NBSP (U+00A0)
case 'L': case 'L':
return "\xE2\x80\xA8"; // LS (#x2028) return "\xE2\x80\xA8"; // LS (U+2028)
case 'P': case 'P':
return "\xE2\x80\xA9"; // PS (#x2029) return "\xE2\x80\xA9"; // PS (U+2029)
case 'x': case 'x':
return Escape(in, 2); return Escape(in, 2);
case 'u': case 'u':