[Typo3-dev] PROBLEM: case conversion and Turkish

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Fri Dec 9 09:56:38 CET 2005


Hi!

I've seen in the Bugtracker an entry about the Turkish I. The problem is 
that TYPO3 sets the locale early (tslib_fe->settingLocale called from 
index.php) in the page processing for *all* string operations which is 
wrong, when it comes to tag processing (eg HTML parsing, custom tags 
like LINK in RTE fields or template markers).

FYI: Turkish has two I's, one with dot and one without. The uppercase 
version of i has a dot, and the lowercase vesion of I has no dot.

But strtolower and strtoupper are locale sensitive. That is they yield 
the expecet results for Turkish text, but fail for tag processing.

Possible solution is either to switch to the (Turkish) locale (LC_CTYPE 
only!) only on demand (probably when doing case conversion in 
tslib_content) or to switch back to the ASCII locale when processing 
markup of some kind.

I prefer the former as I think this is less intrusive in the code. 
Extensions should rarely do a "raw" strtoupper/strtolower (they could 
always use tslib_cObj->caseshift).

Summary:

remove from tslib_fe->settingLocale:

  setlocale(LC_CTYPE,$this->config['config']['locale_all']);

add to tslib_cObj->caseshift:

  setlocale(LC_CTYPE,$this->config['config']['locale_all']);
  [do conversion]
  setlocale(LC_CTYPE,'en_US');

As TYPO3s internal case conversions are currently not locale aware. They 
will have to be changed as well (or they must take a locale/language 
argument).

Masi




More information about the TYPO3-dev mailing list