Project

General

Profile

Actions

Bug #14714

closed

PHP5, flexform and iso-8859-1 charset

Added by Tonni Aagesen over 19 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2005-05-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.7.0
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I'm having some trouble with danish characters like 'æøå' and flexform (This problem apply to umloud etc. as well). If I writeone of those characters in my flexform field and I try to save, I get this error and the data is not saved (I tried setting "forceCharset" with install-tool to no effect.):

[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

The above error was because the XML parser returns "Invalid character" on a string "æøå" etc. - even if charset is set to iso-8859-1 (I tried hardcoding charset to iso-8859-1 too).

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 a diff with patches for t3lib_div and t3lib_tcemain. Theese are tested at to different installations, and works as expected.

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

(issue imported from #M1053)


Files

div_tcemain.diff (3.29 KB) div_tcemain.diff Administrator Admin, 2005-05-03 10:34
Actions #1

Updated by Robert Lemke almost 19 years ago

The problem in case of TemplaVoila (see bug 497) was that no XML header with character set definition was added to the top of the flexform XML. In TemplaVoila version 1.0 this will be done by default.

Actions #2

Updated by Kasper Skårhøj over 18 years ago

See 1273

Actions

Also available in: Atom PDF