Add meta charset in head

The HTTP Content-Type header has precedence but adding a meta charset in the head helps when opening an offline (e.g. downloaded) file in the browser.

Also, note that the official character set name is in uppercase.
See: http://www.iana.org/assignments/character-sets/character-sets.xhtml
This commit is contained in:
Geert De Deckere
2014-09-15 20:34:25 +02:00
parent 08d154fe86
commit 321279e77f

View File

@@ -109,10 +109,11 @@ $handle->execute();
// Store the result into an object that we'll output later in our HTML
$result = $handle->fetchAll(\PDO::FETCH_OBJ);
header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/html; charset=UTF-8');
?><!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>UTF-8 test page</title>
</head>
<body>