summaryrefslogtreecommitdiff
path: root/sys/src/cmd
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-03-13 23:47:24 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2016-03-13 23:47:24 +0100
commit6974a1ecb6474800b19113d1b83c23a2d275c88b (patch)
treec1a2f8449de588094a8c08d96a982248016c5466 /sys/src/cmd
parent99e3bea407cb7c0fb2f8987ed7f9e8cc2957ac17 (diff)
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.
Diffstat (limited to 'sys/src/cmd')
-rw-r--r--sys/src/cmd/uhtml.c3
1 files changed, 2 insertions, 1 deletions
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;