lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lynx-dev] [PATCH] accept <?xml encoding='UTF-8'?>


From: humm
Subject: Re: [Lynx-dev] [PATCH] accept <?xml encoding='UTF-8'?>
Date: Sat, 15 Apr 2023 17:44:13 +0000

Quoth Mouse:
-               flag = !StrNCmp(t, "utf-8", 5);
+               flag = !strncasecomp(t, "utf-8", 5);

I haven't read the full context here, so I could be a bit off-base,
but, surely using strncasecmp (or strncasecomp, whatever that is) is a
bit dodgy here?  You don't want "utf-8-is-stupid" to be taken as
"utf-8", surely?  (Not that I've ever seen the former in the wild, and
I haven't actually read the spec myself, but I doubt it considers all
strings beginning with UTF-8 to be equivalent to UTF-8.)

You are entirely correct. This is one hacky parser. It does consider anything prefixed with utf-8 to be equivalent to utf-8 and that absolutely is bad behavior. By all means, send patches if you will.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]