Take the 2-minute tour ×

There has been some problem showing few characters such as `(acute), ¦ (broken bar) properly in webpage. Most of the characters are shown properly like β, ç are shown properly. But I am fail to understand the problem with only few characters.

My database connection is utf8, the column I am storing data is utf8 and it's being stored properly. My html page encoding is utf8.

Can anyone shed some light on this?

Edit: The troubled characters are shown as �. Also if I use iconv function like this iconv('UTF-8', 'UTF-8//IGNORE', $str); it removes the character.

Also one thing I noticed is that the characters not being shown up correctly are all ISO-8859-1 Symbols as per this link HTML ISO-8859-1 reference Thanks.

share|improve this question
How are the characters displayed? Btw the acute ` is an ASCII character, if it's not shown correctly this isn't just an encoding problem.. –  Joni Feb 17 '12 at 13:30
@JoniSalonen I have edited the question with more info. Can you tell me if there is any workaround to show these kind of character? –  Vivek Feb 17 '12 at 13:34
What you show is a sign of an invalid character (like e.g. a ISO-8859-1 one) being shown in UTF-8 output. Are you 10000% sure those characters are stored properly in your database? Can you show the code you are using to set the database to UTF-8, and to output the data? –  Pekka 웃 Feb 17 '12 at 13:35
@Pekka Yes..I have double checked that it is being stored properly. I am using SET NAMES 'utf8' query on each php page before fetching the data. Let me know if you require more info. –  Vivek Feb 17 '12 at 13:41
I concur with Pekka, looks like invalid utf8 data. How are these characters shown when viewed in ISO-8859-1? e.g. in Firefox View->Character Encoding->Western –  Joni Feb 17 '12 at 13:51
show 1 more comment

2 Answers

Try below code and set character set like ('UTF-8','ISO-8859-1') while fetching data

html_entity_decode('Your content', ENT_QUOTES, 'ISO-8859-1')
share|improve this answer
add comment

Have you tried using the following in your HTML:

&acute;  (acute)
&brvbar; (broken bar)

Seems to work on this site in any case:

´ ¦

This site has more information:


share|improve this answer
add comment

Your Answer


