|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Karel S. Smarty Rookie
Joined: 03 Aug 2009 Posts: 26 Location: The Netherlands
|
Posted: Thu Aug 27, 2009 2:02 pm Post subject: Escape plugin crash with other charset |
|
|
Hi,
Try this:
Code: |
header ( 'Content-Type: text/html; charset=ISO-8859-15' );
|
Code: |
$test = 'Mét (Dutch word)';
$smarty->assign ( 'test', $test );
|
Now, the output is an empty string. That's because the default charset for Smarty is UTF-8. I known, you can fix this by setting $smarty->resource_char_set to ISO-8859-15. And that works fine, but returning an empty string (when script charset <> Smarty charset) is not that handy for debugging. It took a while before we located the source of the problem. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Aug 27, 2009 3:41 pm Post subject: |
|
|
Smarty can not know what string you have passed as charset at the header function. The only idea I have right now is to make $smarty->resource_char_set as master for the specificion.
Code: | header ( "Content-Type: text/html; charset=$smarty->resource_char_set" ); |
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|