[TYPO3-core] RFC #10838: t3lib_cs->utf8_decode() does not check whether the target charset is utf8

Dmitry Dulepov dmitry at typo3.org
Fri Apr 3 13:02:36 CEST 2009


Hi!

Ingo Renner wrote:
> Solution:
> A simple check for the target charset being utf8 solves the problem, the
> string can then be returned as is.

I propose to change:

if ($charset === 'utf-8')	return $str;

to:

if (strcasecmp($charset, 'utf-8') === 0) {
	return $str;
}

Reasons:
- conforms to CGL
- case-insensitive comparison

-- 
Dmitry Dulepov
In TYPO3 blog: http://dmitry-dulepov.com/article/creating-a-mobile-version-of-a-web-site.html
Twitter: http://twitter.com/dmitryd
Skype: liels_bugs


More information about the TYPO3-team-core mailing list