Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

UTF-8 unrecognised character

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
zoezoe
Smarty n00b


Joined: 18 Jan 2016
Posts: 2

PostPosted: Mon Jan 18, 2016 10:03 am    Post subject: UTF-8 unrecognised character Reply with quote

Good morning,

I am new to developing and to using smarty.
I have a random character in my database which my smarty template does not recognise. The character is in the middle of the intended output, the output is not displayed and messes up the template from the point where the output should be displayed. The character is ’
I have used php's mb_detect_encoding and it says its UTF - 8.

Does anyone know if there is any way to get this character to display?

*update to original question
I have found that the first time the variable is output nothing appears but the data does appear on subsequent outputs?


Last edited by zoezoe on Mon Jan 18, 2016 3:30 pm; edited 1 time in total
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Mon Jan 18, 2016 1:23 pm    Post subject: Reply with quote

mb_detect_encoding is not fool-proof.
But your issue is irrelevant to it.
If your database contains wrong characters, that means you're not using tright encoding to connect to it, which means, your problem is outside Smarty.
Back to top
View user's profile Send private message
zoezoe
Smarty n00b


Joined: 18 Jan 2016
Posts: 2

PostPosted: Mon Jan 18, 2016 4:43 pm    Post subject: Reply with quote

After some help I have discovered that the character is definitely UTF - 8 it's (0xe28099), right single quotation mark.

After further investigation I have discovered that:
* with the above character the variable shows on all outputs apart from the first output.

* without the above character the variable shows on all outputs.

I would greatly appreciate it if anyone could help me with this. Thanks
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Jan 20, 2016 8:13 am    Post subject: Reply with quote

That just can't be true.
And without seeing your full code it is not possible to tell what you are doing wrong.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP