=> ac0e27574c21ce763af28377c450bcebf5b1c86b
[1mdiff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c[m [1mindex 23d3d451..eee0c1ea 100644[m [1m--- a/src/ui/documentwidget.c[m [1m+++ b/src/ui/documentwidget.c[m [36m@@ -1576,6 +1576,17 @@[m [mstatic void updateDocument_DocumentWidget_(iDocumentWidget *d,[m }[m setFormat_GmDocument(d->view->doc, docFormat);[m /* Convert the source to UTF-8 if needed. */[m [32m+[m[32m if (equalCase_Rangecc(charset, "utf-8")) {[m [32m+[m[32m /* Verify that it actually is valid UTF-8. */[m [32m+[m[32m if (!isUtf8_Rangecc(range_String(&str))) {[m [32m+[m[32m if (strstr(cstr_String(&str), "\x1b[")) {[m [32m+[m[32m charset = range_CStr("cp437"); /* An educated guess. */[m [32m+[m[32m }[m [32m+[m[32m else {[m [32m+[m[32m charset = range_CStr("latin1");[m [32m+[m[32m }[m [32m+[m[32m }[m [32m+[m[32m }[m if (!equalCase_Rangecc(charset, "utf-8")) {[m set_String(&str,[m collect_String(decode_Block(&str.chars, cstr_Rangecc(charset))));[m [1mdiff --git a/src/ui/text.c b/src/ui/text.c[m [1mindex 911a4fb6..c48645f6 100644[m [1m--- a/src/ui/text.c[m [1m+++ b/src/ui/text.c[m [36m@@ -84,7 +84,7 @@[m [mint ansiFlags_Text(void) {[m }[m [m iRegExp *makeAnsiEscapePattern_Text(iBool includeEscChar) {[m [31m- const char *pattern = "\x1b[[()][?]?([0-9;AB]*?)([ABCDEFGHJKSTfhilmn])";[m [32m+[m[32m const char *pattern = "\x1b[[\\(\\)][?]?([0-9;AB]*?)([ABCDEFGHJKSTfhilmn])";[m if (!includeEscChar) {[m pattern++;[m }[m [36m@@ -251,7 +251,7 @@[m [mvoid drawOutline_Text(int fontId, iInt2 pos, int outlineColor, int fillColor, iR[m }[m #else[m drawRange_Text(fontId, pos, fillColor | fillBackground_ColorId, text);[m [31m-#endif [m [32m+[m[32m#endif[m }[m [m iTextMetrics measureWrapRange_Text(int fontId, int maxWidth, iRangecc text) {[m
text/gemini; charset=utf-8
This content has been proxied by September (3851b).