Hello,

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,
Thanks!

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

I can understand your problem. That is your

Text displayed as intended:
election
Text encoded as UTF-8 but displayed as ISO-8859-1:
A~clection
Text encoded as ISO-8859-1 but displayed as UTF-8:
!?[]ction

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!

Thanks

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.