bug-gnu-libiconv
[Top][All Lists]
Advanced

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

[bug-gnu-libiconv] iconv and charset names


From: Jeffrey Walton
Subject: [bug-gnu-libiconv] iconv and charset names
Date: Fri, 10 May 2019 13:36:02 -0400

Hi Everyone/Bruno,

Interesting observation from the field...
https://stackoverflow.com/a/56082270/608639:

    Take care of case, web pages usually show lowercase like
    that < charset=iso-8859-1"/> and iconv uses uppercase.

I think iconv should canonicalize the charset name and avoid the
failure for the user. Probably by using stricmp or strcasecmp or
similar.

The algorithm you use to identify a charset name likely runs in O(n).
The insensitive string compare may add an additional operation so it
runs in O(2n). O(2n) is still just O(n).

So you have little to no downside for the library (loss of
efficiency), but you have an upside for the user (no spurious
failures).

Jeff



reply via email to

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