[TYPO3-core] RFC: Fix Bug 6428 - strtoupper doesn't work with turkish i
Steffen Kamper
steffen at sk-typo3.de
Mon Oct 29 10:21:17 CET 2007
"Steffen Kamper" <steffen at sk-typo3.de> schrieb im Newsbeitrag
news:mailman.1.1193574840.31071.typo3-team-core at lists.netfielders.de...
>
> "Ernesto Baschny [cron IT]" <ernst at cron-it.de> schrieb im Newsbeitrag
> news:mailman.1.1193570491.28448.typo3-team-core at lists.netfielders.de...
>
>>
>> A nice idea would be to have a t3lib_div::asciiToUpper($string) method
>> which will only handle 7bit characters but will ignore current locale
>> (doing tr/a..z/A..Z/ for example). I think there are many extensions
>> which do a strtoupper for internal purposes without thinking about the
>> implication with other locales. Even I didn't know about that
>> restriction in turkish. I thought a-z was "alphabetic" characters in all
>> languages. :)
>>
>> Cheers,
>> Ernesto
>
> indeed that would be the best solution. I start to try this but was
> unlucky for now.
>
> btw - in php6 this will be corrected, but not for php5:
> http://bugs.php.net/bug.php?id=42063
>
> vg Steffen
>
any comments on using a function like that?
function asciiToCase($string,$case) {
if($GLOBALS['TSFE']->tmpl->setup['config.']['locale_all']) {
$tmp=$GLOBALS['TSFE']->tmpl->setup['config.']['locale_all'];
setlocale(LC_CTYPE,'en');
$caseString=$case=='upper' ? strtoupper($string) : strtolower($string);
setlocale(LC_CTYPE,$tmp);
} else
$caseString=$case=='upper' ? strtoupper($string) : strtolower($string);
return $caseString;
}
maybe it should also take care of BE.
vg Steffen
More information about the TYPO3-team-core
mailing list