[Typo3-dev] flexform and special characters

Tonni Aagesen goes.to at dev.null
Mon May 2 18:49:25 CEST 2005


Tonni Aagesen wrote:

> [client 127.0.0.1] PHP Warning:  reset() [<a
> href='function.reset'>function.reset</a>]: Passed variable is not an
> array or object in
> /home/ta/work/src/typo3_src-3.7.0/t3lib/class.t3lib_div.php on line
> 1398, referer:
> http://t37dev/typo3/alt_doc.php?&returnUrl=%2Ftypo3%2Fsysext%2Fcms%2Flayout%2Fdb_layout.php%3F%26id%3D2&edit[tt_content][12,]=edit

Spend half the day trying to sort this out. The above error was because
the XML parser returns "Invalid character" on a string "æøå" - even if
charset is set to iso-8859-1.

Now, I actually have come to some sort of solution, that seems to work.
The trick is to use utf8_encode()/utf8_decode() and force flexform XML
to charset utf-8.

The theory is that double encoded string:

$str = utf8_encode(utf8_encode($str));

is still utf-8 and can be decoded by

$str = utf8_decode(utf8_decode($str));

Thus this should work for both utf-8 and iso-8859-1.

I've attached two diff's to this message which you can take a look at.


-- 
Regards
Tonni Aagesen
www.pil.dk && www.quickpay.dk


More information about the TYPO3-dev mailing list