about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/SGML.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2010-10-04 00:27:34 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2010-10-04 00:27:34 -0400
commit71953b403f2b13e5001b00860cd425dd1e98e710 (patch)
treeef397e0947f2bd72b724987af50b07906715cfe6 /WWW/Library/Implementation/SGML.c
parent46d0ee0fbd6a6f267c01130d32af1eeefdb87d15 (diff)
downloadlynx-snapshots-71953b403f2b13e5001b00860cd425dd1e98e710.tar.gz
snapshot of project "lynx", label v2-8-8dev_5g
Diffstat (limited to 'WWW/Library/Implementation/SGML.c')
-rw-r--r--WWW/Library/Implementation/SGML.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index d00b5be3..0b1edebc 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: SGML.c,v 1.139 2010/09/25 15:40:04 tom Exp $
+ * $LynxId: SGML.c,v 1.140 2010/10/04 00:04:12 tom Exp $
  *
  *			General SGML Parser code		SGML.c
  *			========================
@@ -39,6 +39,11 @@
 # include <LYPrettySrc.h>
 #endif
 
+#define AssumeCP1252(context) \
+	(((context)->inUCLYhndl == LATIN1 \
+	  || (context)->inUCLYhndl == US_ASCII) \
+	 && !(context)->extended_html)
+
 #define INVALID (-1)
 
 static int sgml_offset;
@@ -1910,8 +1915,7 @@ static void SGML_character(HTStream *context, int c_in)
 	 *
 	 * http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#character-encodings-0
 	 */
-	if (context->inUCLYhndl == LATIN1
-	    || context->inUCLYhndl == US_ASCII) {
+	if (AssumeCP1252(context)) {
 	    clong = LYcp1252ToUnicode((UCode_t) c);
 	    goto top1;
 	}
@@ -2641,7 +2645,9 @@ static void SGML_character(HTStream *context, int c_in)
 		UCode_t code = (UCode_t) lcode;
 
 /* =============== work in ASCII below here ===============  S/390 -- gil -- 1092 */
-		code = LYcp1252ToUnicode(code);
+		if (AssumeCP1252(context)) {
+		    code = LYcp1252ToUnicode(code);
+		}
 		/*
 		 * Check for special values.  - FM
 		 */