1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

[html] Check encoding line ( <?xml version="1.0" encoding="utf-8"?> )

This commit is contained in:
Witold Filipczyk 2023-07-27 11:41:43 +02:00
parent 90d4f17031
commit 450eda0283

View File

@ -1241,6 +1241,16 @@ sp:
}
if (s >= eof) return;
if (s + 2 <= eof && (s[1] == '!' || s[1] == '?')) {
if (!strncmp(s, "<?xml ", 6)) {
he = get_attr_val(s + 6, "encoding", cp);
if (he) {
add_to_string(head, "Charset: ");
add_to_string(head, he);
add_crlf_to_string(head);
mem_free(he);
}
}
s = skip_comment(s, eof);
goto se;
}