I have a database where content (song lyrics) is stored in multiple languages. But now that i'm testing it some characters do not appear correctly. For example, when i'm retrieving information (searching anything), the letter ë appears as � (a special character square - in case it doesn't appear). The letter itself is stored as ë in the database.

When i search for ë, the results that appear instead of ë contain « or » (im not sure which as they always come in pair).

I tried using htmlentities but then i don't get anything at all. The strings that should contain these letters are instead just blank.

I'using this meta tag for the encoding:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

When i test it on a blank page without any html at all, just directly echoing the results, they appear fine.

Any ideas are much appreciated,

PS: I can PM anyone who is interested a link to the web page where this is at.

Edited by Leandro-AL: n/a

8 Years
Discussion Span
Last Post by Jayavardhan

I can understand your problem. That is your

Text displayed as intended:
Text encoded as UTF-8 but displayed as ISO-8859-1:
Text encoded as ISO-8859-1 but displayed as UTF-8:

I think It is good practice to use the same encoding at all stages in document production, from text editing to display in a Web browser. If you see characters correctly at one part of the process but incorrectly at another part, then you are almost certainly not using the same encoding throughout.
It is better to specify the character encoding in the HTTP header transmitted from a Web server, but this is not under the control of most writers.


Thanks for your reply.

Well, i'm pretty sure that i use utf8 everywhere. I have it in the header template that is loaded in all pages and my database is utf8 unicode.

Do you have any idea how i can solve this? If i echo the info from the DB to a blank page with no html at all it appears fine!



Ok. I can't help you boss. U did a right thing every where. I don't know why you not getting. Sorry.....!!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.