[TYPO3-dev] strange behavior with turkish locale-settings

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Mon Nov 20 16:08:42 CET 2006


Steffen Kamper schrieb:
> "Martin Kutschker" <martin.kutschker-n0spam at no5pam-blackbox.net> schrieb im 
> Newsbeitrag 
> news:mailman.1.1163943702.13157.typo3-dev at lists.netfielders.de...
> 
>>Steffen Kamper schrieb:
>>
>>>"Martin Kutschker" <martin.kutschker-n0spam at no5pam-blackbox.net> schrieb 
>>>im Newsbeitrag 
>>>news:mailman.1.1163930867.18908.typo3-dev at lists.netfielders.de...
>>>
>>>>Hm, I recall that Trukisj users reported problems with markers that 
>>>>contain the letter i as a case conversion will not result in an I (no 
>>>>dot) but an I with a dot on top.
>>>>
>>>>So if the PHP code uses internally an I use it in the template (or use 
>>>>the i without the dot).
>>>>
>>>>OTOH, if the code uses internally an i use it (or use the I with the 
>>>>dot).
>>>>
>>>>Maybe this will help you.
>>>>
>>>>Masi
>>>>
>>>
>>>Hi Masi,
>>>
>>>thx a lot - i thing this is the problem, cause there is an I in 
>>>Markername. I will talk to Mario how to prevent this
>>
>>Not so easy to solve. Or rather easy to solve if you know the problem, but 
>>besides Turkish only one other language has this problem. So I fear only a 
>>few developers will remember not use use strtoupper on marker names with a 
>>Turkish locale setting.
>>
>>AFAIR some of the TYPO3 marker/template APIs have an option to uppercase 
>>the marker names. Maybe it's sufficient if strtoupper is replaces by a 
>>strtr in these functions.
>>
>>Masi
> 
> 
> thx Masi, i will investigate
> Can you tell me which other language causes troubles ?

Azerbaijani, Crimean Tatar and Tatar languages.

see http://en.wikipedia.org/wiki/Turkish_dotted_and_dotless_I

> I looked to the Markers and this are the names:
> ###IMG_PATH###
> ###DISPLAY_DATE###
> ###MONTH_TITLE###
> ###L_THIS_MONTHS###
> these markers are leaved unreplaced.
> 
> As you can see, all Names are with uppercase I , so no php-conversion is 
> used.
> There are some more markers using the I and they are replaced, that i don't 
> understand.
> 
> In code there i found this:
>  preg_match_all('!\###MONTH_([A-Z]*)\|?([+|-])([0-9]{1,2})\###!is', $page, 
> $match);
> 
> and no conversion like strtoupper.

But there is the modifier "i" used. preg_match will either uppercase or 
lowercase the regexp definition and the regexp data, so there is probably 
an implicit strtoupper/strtolwer here. But that's easy to test wit a few 
lines of PHP.

To avoid such problems I'd drop the whole case stuff in markers and think 
it's much easier to use and allow only markers in upper case (in the 
template code). I think that the I problem is one issue amongst others why 
xml is not case insensitive.

> If i understood you right, the problem 
> will occure on using lowercase i and strtoupper - or are there more pitfalls 
> ?

I don't think so, but as seen in the preg_match those case conversion 
problems may pop up at unexpected places.

Masi




More information about the TYPO3-dev mailing list