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

Ingo Renner ingo at typo3.org
Fri Apr 3 12:49:44 CEST 2009


Hi all,

This is a SVN patch request

Type: bugfix

Branches: trunk, 4.2 (4.1, 4.0 if wanted)

BT reference: http://bugs.typo3.org/view.php?id=10838

Problem:
When using t3lib_cs->utf8_decode() to decoding an utf8 string to another 
charset the function does not check whether the target charset is utf8. 
This can lead to scrambled content.

This can especially happen with backends running as utf8.

Steps To Reproduce	
With kickstarter create a new extension containing a table with a single 
field f.e.. Then go to view result, you'll notice that the content for 
the locallang_db.xml file is not shown when running in a utf8 backend. 
This is because the content got scrambled.

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


best
Ingo

-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 10838.diff
Type: text/x-diff
Size: 465 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090403/92cb1e75/attachment.diff 


More information about the TYPO3-team-core mailing list