Reputation: 8440
In one array there's a variable that has an é
in it. I tried to replace it with a normal e
using
echo strtr($var, "é", "e");
but even that doesn't work. It's weird. At the top of my page there's
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
then when I load the page the é
character gets converted to [[#233]]
and a plugin to convert things to pdf is saying to me that the document contains invalid UTF-8 character(s)
.
Anyone got a clue? The variable between comes from a latin1_swedish_ci database field.
Upvotes: 1
Views: 5514
Reputation: 3557
just add $html = iconv("UTF-8","UTF-8//IGNORE",$html); and pass this $html to your view
Upvotes: 1
Reputation: 14678
Before any query (select/insert/update) call this statement:
SET NAMES utf8;
Maybe you will need re-create your data in DB. Try to insert some new records and selected them.
Upvotes: 2
Reputation:
It could be that your array was written in a file that was not encoded in UTF-8. The discrepancy between your page encoding and the encoding announced with the meta tag causes problem. Make sure you've got the right encoding configured in your text editor or IDE.
Upvotes: 1
Reputation: 109
Please check in database, In which Format é stored. if It Stored in this
è è è
format than you have to replace with this code.
Upvotes: 1
Reputation: 7063
That é being 00E9 sounds like Windows-1252 (CP1252). Not in the control range but I've had similar issues. Could use iconv
to convert it and ensure valid UTF-8.
Upvotes: 2