|
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 |
gotsmarty Smarty Rookie
Joined: 15 May 2007 Posts: 8
|
Posted: Thu Jun 05, 2014 11:04 am Post subject: html tag and encoding |
|
|
Hi there,
I have notice a really strange behaviour in Smarty (3)
When i assign a string variable to the template, with some html tag, the (utf8) encoding fail in the template.
for example:
wtih
$smarty->assign('test', "déjà bonjour <br>");
the {$test} variable in template display:
déjà bonjour <br>
if I change the <br> to <br/> or <br />, it's ok (déjà bonjour)
The same problem occured with <div>, <a> and <table> tag......
An idea? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Jun 05, 2014 3:08 pm Post subject: |
|
|
Did you set your browser to utf-8 charset with a meta tag?
Code: | <meta http-equiv="Content-type" content="text/html; charset=UTF-8" /> |
|
|
Back to top |
|
gotsmarty Smarty Rookie
Joined: 15 May 2007 Posts: 8
|
Posted: Thu Jun 05, 2014 3:17 pm Post subject: |
|
|
yes, absolutely.
And as I said, it works in general.
The issue only occured when the string variable contain some of html tags (<br>,<div>,..)
(note that it is working with some others (<span>, <b>, <br />,....) |
|
Back to top |
|
gotsmarty Smarty Rookie
Joined: 15 May 2007 Posts: 8
|
Posted: Thu Jun 05, 2014 4:01 pm Post subject: |
|
|
oops!
sorry I found the solution.
And the problem was not in Smarty engine but in a custom function that I didn't even know the existence
Thanks for support |
|
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
|