[TYPO3-core] RFC: #2302: substitute all strtoupper/strtolower with the t3lib_div-method

Ernesto Baschny [cron IT] ernst at cron-it.de
Wed Jul 2 14:52:44 CEST 2008


Martin Kutschker wrote: on 02.07.2008 14:04:

>> I would suggest to make the function documentation more precise. It
>> currently says:
>>
>>          * Converts string to lowercase
>>          * The function converts all Latin characters (A-Z, but no
>> accents, etc) to
>>          * lowercase. It is safe for all supported character sets (incl.
>> utf-8).
>>          * Unlike strtolower() it does not honour the locale.
>>
>> First it shouldn't say it works on "all Latin characters", but on all
>> ASCII (7-bit) characters. Then "it is safe for all supported character
>> sets (incl. utf-8)" is even more misleading.

>> but
>> someone that doesn't might think this function can convert even UTF-8
>> data to lowercase. So I suggest to have it like:
>>
>>     * Converts ASCII strings to lowercase
>>     * Only A-Z character are considered. Only use this method for
>>     * strings where you expect only ASCII characters (e.g. markers).
>>     * Unlike strtolower() it does not honour the locale (i.e. also
>>     * works on turkish locale).

> Well, what I meant with utf8-safe is that it won't garble any utf8 data,
>  as it works only on the ASCII/7bit part. So in fact you can use it on
> any supported charset without troubles as long as you keep in mind that
> only the letters A-Z are converted to lower case.

Ok, but it doesn't make any sense to use it on utf-8 data, right? :) I 
can see no use-case in converting "abäch" to "ABäCH" for example. Maybe 
the phpdoc part should even point to the t3lib_cs->case method for utf-8 
and language specific translations.

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list