[TYPO3-dev] Your opinion about a possible bug in t3lib_cs

Marcus Krause marcus#exp2008 at t3sec.info
Tue Dec 9 07:23:31 CET 2008


Francois Suter schrieb:
> [...]
> 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.
> 
> The more I think about it, the more I suppose the correct answer is b),
> but it seems to me that a proper API would rather behave like a).

I would also vote for b).

If the developer has control of the supplied charset he will be able to
provide the proper one, if not (e.g. got charset string from user input)
he could use parse_charset() before to get a proper one.

So the current implementation is sufficient to work around possible
issues with charsets.


Marcus.




More information about the TYPO3-dev mailing list