There is a problem using unicode text with the drupal phptal engine.
When entering content cotaining Swedish characters in the default drupal theme (bluemarin), it displays OK when drupal renders it. When switching theme engine to PHPtal engine (tal_grey) the page encoding is reported as UTF-8, but the actual text is in reality rendered as iso-8859-1 (which I can confirm by forcing the character encoding to be iso-8859-1 for that page in firefox).
The net result is that the page says it is utf-8 encode, but the contents will not display properly unless the encoding is manually changed to iso-8859-1.
Comments
Comment #1
boci commentedThe problem:
the PHPTal produced code is paritaly contain html entities, it's contain html entities ( example á) and standard characters (example; á), And when html_entities_decode parsing the text it's give back bad result.
My first solution:
I change the phptal.engine:
to
It's convert the <,>,& and " character to the right form because ignore the special characters (example » (») , á (á) etc...)
Secod solution:
modify the
to
becuse it's not work correctily. Example the »(») character is bad.
Comment #2
boci commentedHi again!
I found another solution.
in phptal.engine :
change
to
and change the libs/PHPTAL/OutputControl.php
to
This solution generate a right code, please anybody migrate this patch into phptal.
Comment #3
olav commentedThis problem is gone after the rewrite, at least under PHP 5 / PHPTAL 1.0. Ümläuts both in content and in the templates do work now.