[Typo3-dev] tslib_fe->csConv()

Kasper Skårhøj kasper at typo3.com
Tue Apr 20 21:19:21 CEST 2004


> 
> I have a bad habit of renaming thing when I get the impression that I 
> have an idea for a naming scheme that is so much nicer :-)


I have the same urge. I just know how much it hurts if you do it after
dependencies might have arisen.


> 
> >>dbConv would get it's "internal" conversoin arguments by 
> >>SYS[forced_charset] and config.metaCharset. Can be used on results of 
> >>SQL queries.
> > 
> > Where would this function be called? If people know the charset of the
> > input string they just use "csConv" with the second argument set.
> 
> It would relieve them from the burden of knowing the internal charset. 
> Mind that you have to check if SYS[forced_charset] is set, and if not, 
> consult the "magic" array of t3lib_cs.
> 
> > BTW, there is a property for stdWrap called "csConv" which allows just
> > that.
> 
> Good for Typoscript, but in a plugin I want a PHP API.

Of course.


I'm not convinced yet how much this is needed, in particular I'm still
not clear on the actual cases that will arise. My position is to collect
some actual experience/cases where we can clearly identify what the need
is for common implementation before we move to make convenient logic.
Till then there are workarounds that will do it all.


> The reason for suggesting to move the initializatoin is that 
> initLLvars() will be called when you use the label API, but some code 
> might want use siteCharset, etc but not the label calls.


Then (for now) the function will call initLLvars() on its own. I might
agree with you later, but lets see what happens. See argument from
above.

(Mainly I'm reluctant because it adds overhead. And implementing it is
one of those cases of no-way-back when done).

> > 
> > As long as there is some hardcoded way to set it when the intelligence
> > breaks.
> 
> I'm not really happy with this. But I fear many users would stumble 
> across the locale problem.


As said; you are free to experiment. As long as there is a hardcoded
fall-back value it can't be mission critical.

I would normally recommend a manually set value since intelligence seems
to highten the risk of very hard-to-find bugs.


- kasper







More information about the TYPO3-dev mailing list