shithub: riscv

Download patch

ref: 6974a1ecb6474800b19113d1b83c23a2d275c88b
parent: 99e3bea407cb7c0fb2f8987ed7f9e8cc2957ac17
author: cinap_lenrek <[email protected]>
date: Sun Mar 13 19:47:24 EDT 2016

uhtml: dont trust charset=utf-8 attribute, verify.

when the charset is explicitely specified as utf-8, ignore it
for now. we'll assume utf-8 when all bytes have been properly
utf-8 encoded.

--- a/sys/src/cmd/uhtml.c
+++ b/sys/src/cmd/uhtml.c
@@ -122,7 +122,8 @@
 		}
 		t = *e;
 		*e = 0;
-		if((a = attr(g, "encoding")) != nil || (a = attr(g, "charset")) != nil){
+		if((a = attr(g, "encoding")) != nil || (a = attr(g, "charset")) != nil)
+		if(cistrcmp(a, "utf") != 0 && cistrcmp(a, "utf-8") != 0){
 			cset = a;
 			*e = t;
 			break;