[TYPO3-dev] Your opinion about a possible bug in t3lib_cs
Thorsten Kahler [dkd]
thorsten.kahler at dkd.de
Tue Dec 9 10:00:48 CET 2008
Hi Francois,
Francois Suter schrieb am 08.12.2008 21:05 Uhr:
>
> This is due to the fact that t3lib_cs::specCharsToASCII() expects the
> encoding to be spelled strictly, i.e. 'utf-8' and not 'utf8'. If
> t3lib_cs::specCharsToASCII() called t3lib_cs::parse_charset() internally
> it would find the right name for the encoding and do the expected
> transformation.
>
that's the way t3lib_cs is used in the core (nearly always - I just
stumbled over a potentially wrong usage in t3lib_basicfilefunc).
> So which answer is correct:
>
> a) it's a bug, t3lib_cs::specCharsToASCII() (and quite a few other
> functions actually) should call t3lib_cs::parse_charset() (thus hiding
> the ugly details from the developer).
>
> b) it's the developer's responsibility to call t3lib_cs::parse_charset()
> himself before passing an encoding code to any of the t3lib_cs methods.
>
So b) is the correct answer. But stating that more clearly in PHPDoc
wouldn't hurt.
Regards
Thorsten
--
Thorsten Kahler
thorsten.kahler at dkd.de
More information about the TYPO3-dev
mailing list