Wireshark mailing list archives

Re: Alternatives to atoi and tolower


From: Guy Harris <guy () alum mit edu>
Date: Fri, 7 Jul 2017 01:43:57 -0700

On Jul 7, 2017, at 1:08 AM, Pascal Quantin <pascal.quantin () gmail com> wrote:

g_ascii_tolower

Note: in a given locale, "i" isn't necessarily the lower-case version of "I".

In fact, it's definitely *not* the lower-case version of "I" in Turkish.  This caused crashes at one point:

        https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2010

g_ascii_tolower() gives the same answer in all locales.  If you're dealing with a configuration file, then, unless the 
configuration file's language is based on Turkish (or Azerbaijani, Kazakh with the Roman alphabet, Tatar with the Roman 
alphabet, or Crimean Tatar, if the Wikipedia page

        https://en.wikipedia.org/wiki/Dotted_and_dotless_I

is correct), that answer is the one you want.  (And if it *is* based on one of those languages, you would *still* want 
the same answer in all locales, as there's no guarantee that the file would only be read in a Turkish, Azerbaijani, 
Kazakh, Tatar, or Crimean Tatar locale, so you'd have to map "I" to "ı" and "İ" to "i".)
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: