added lowercase conversion to ASCII strings

This commit is contained in:
Tim Ruehsen 2014-06-18 12:39:55 +02:00
parent a0a9e76261
commit e6e0f7759f
1 changed files with 9 additions and 1 deletions

View File

@ -857,8 +857,16 @@ int psl_str_to_utf8lower(const char *str, const char *encoding, const char *loca
/* shortcut to avoid costly conversion */
if (_str_is_ascii(str)) {
if (lower)
if (lower) {
char *p;
*lower = strdup(str);
/* convert ASCII string to lowercase */
for (p = *lower; *p; p++)
if (isupper(*p))
*p = tolower(*p);
}
return 0;
}