From 6974a1ecb6474800b19113d1b83c23a2d275c88b Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 13 Mar 2016 23:47:24 +0100 Subject: [PATCH] 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. --- sys/src/cmd/uhtml.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/src/cmd/uhtml.c b/sys/src/cmd/uhtml.c index 21db3d5b8..bef236f43 100644 --- a/sys/src/cmd/uhtml.c +++ b/sys/src/cmd/uhtml.c @@ -122,7 +122,8 @@ main(int argc, char *argv[]) } 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;