[Top][All Lists]

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

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

From: Mouse
Subject: Re: [Lynx-dev] [PATCH] accept <?xml encoding='UTF-8'?>
Date: Sat, 15 Apr 2023 12:34:56 -0400 (EDT)

> -             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.)

In the case of UTF-8, it's less likely to be a problem in practice, but
there are other cases where it's a bigger issue; for example,
ISO-8859-1 and ISO-8859-14 are very different.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML      
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

reply via email to

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