about summary refs log tree commit diff stats
path: root/WWW
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2023-10-04 23:50:20 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2023-10-17 07:32:44 +0000
commitb0c270d7f89b80207e5cd514da2b0e5af54670e6 (patch)
tree944f152e6093d84488eea9559a7fb274615d2448 /WWW
parent71036c5877fea5016554f5034333beb251bdb227 (diff)
downloadlynx-snapshots-b0c270d7f89b80207e5cd514da2b0e5af54670e6.tar.gz
snapshot of project "lynx", label v2-9-0dev_12h
Diffstat (limited to 'WWW')
-rw-r--r--WWW/Library/Implementation/SGML.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index e2d15922..5bf8db97 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: SGML.c,v 1.184 2023/07/30 18:12:21 Hiltjo.Posthuma Exp $
+ * $LynxId: SGML.c,v 1.185 2023/10/04 23:42:42 tom Exp $
  *
  *			General SGML Parser code		SGML.c
  *			========================
@@ -902,10 +902,13 @@ static void handle_processing_instruction(HTStream *me)
 	    char *t = strstr(s, "encoding=");
 
 	    if (t != 0) {
+		char delim = 0;
+
 		t += 9;
-		if (*t == '"')
-		    ++t;
-		flag = !StrNCmp(t, "utf-8", 5);
+		if (*t == '"' || *t == '\'')
+		    delim = *t++;
+		flag = (!strncasecomp(t, "utf-8", 5) &&
+			(delim == 0 || t[5] == delim));
 	    }
 	    if (flag) {
 		CTRACE((tfp, "...Use UTF-8 for XML\n"));