user5386998
user5386998

Reputation:

Encoding Issues �

Getting the symbol from the above and I'm at a loss what I'm missing. What I've done so far.

Set on header

<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

Database output charset: UTF8

$char = mysqli_character_set_name($conn);
echo "The current character set is: $char\n"; 

Set on file.

mysqli_set_charset($conn, "utf8");

File is: UTF 8 Database Table is: utf8_general_ci

EDIT: SHOW TABLE

CREATE TABLE `testimonials` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`showflag` varchar(10) NOT NULL DEFAULT '10',
`heading` varchar(155) DEFAULT NULL,
`testimonial` longtext NOT NULL,
`name` varchar(50) NOT NULL,
`domain` varchar(50) DEFAULT NULL,
`date` date NOT NULL,
`image` varchar(255) DEFAULT NULL,
`rating` int(1) DEFAULT '5',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8

EDIT: Database storage is fine, the issue occurs on output only.

Upvotes: 1

Views: 42

Answers (2)

Chris Lam
Chris Lam

Reputation: 3614

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

You are setting charset to iso-8859-1..Try changing it to utf-8

Your second meta tag is only useful only for HTML4 though. For modern browsers that work well with HTML5, having only <meta charset="UTF-8" /> is good enough.

Upvotes: 2

Rick James
Rick James

Reputation: 142278

You seem to have a contradiction with the two meta clauses -- use the same charset.

Look for "black diamond" in http://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored

Let's see SHOW CREATE TABLE; the column is the important part.

Upvotes: 2

Related Questions