Loading...
<head>
<title>Café</title>
<meta charset="utf-8">
</head><head>
<meta charset="utf-8">
<title>Café</title>
</head>The charset declaration must be within the first 1024 bytes, so it goes first in <head>, before any text.
<meta charset="utf-8"> at the very top of <head>.Content-Type header.UTF-8 bytes were decoded as another encoding, often Latin-1. Make the file, the Content-Type header and the database all use UTF-8.
Both encode all of Unicode. UTF-8 uses one to four bytes and matches ASCII; UTF-16 uses two or four bytes and is what JavaScript strings use inside.
No. A byte order mark is not needed for UTF-8 and can break scripts, JSON parsers and concatenated files.