apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Malo ...@perlig.de>
Subject locale independent apr_str_eq function?
Date Fri, 01 Aug 2003 15:53:09 GMT
I'm wondering if it would be useful to provide such a function in apr,
because:

- nearly all occurences of str(case)cmp are just interested in equality, but
take the extra overhead for the -1/+1 comparison of strcmp
- strcasecmp is locale dependent, even if you just want to use ascii. For
example, in the turkish locale i and I are not the case compagnions of each
other (there's a httpd bug report somewhere regarding to this). Deadly if
you're trying to compare something with an I in it.

So my proposal would be to write a str_eq and str_case_eq function, which just
checks for equality, case translation is limited to us-ascii alphabet (via a
simple table).

What do you think? Would that fit into the apr concepts? where?

nd

Mime
View raw message