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.
This commit is contained in:
cinap_lenrek 2016-03-13 23:47:24 +01:00
parent 99e3bea407
commit 6974a1ecb6

View file

@ -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;