# Legacy encoding “iso-8859-15” used. Documents must use UTF-8.

> Canonical HTML version: https://rocketvalidator.com/html-validation/legacy-encoding-iso-8859-15-used-documents-must-use-utf-8
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

HTML documents must use UTF-8 as their character encoding. The legacy encoding `iso-8859-15` is no longer allowed in modern HTML.

The HTML living standard requires all documents to be encoded in UTF-8. Older encodings like `iso-8859-15` (also known as Latin-9) were common in the past, especially for Western European languages, but they are now considered legacy. UTF-8 supports virtually all characters from every writing system, making it the universal standard for the web.

To fix this, you need to do two things. First, update the `<meta>` charset declaration in your HTML to specify UTF-8. Second — and this is the important part — you must actually save or convert the file itself to UTF-8 encoding. Simply changing the meta tag without re-encoding the file can cause characters like `é`, `ñ`, or `€` to display incorrectly.

Most modern code editors (VS Code, Sublime Text, Notepad++) let you change the file encoding. In VS Code, click the encoding label in the bottom status bar and choose "Save with Encoding" → "UTF-8".

If your server is sending an `iso-8859-15` charset in the HTTP `Content-Type` header, you'll also need to update that. The HTTP header takes precedence over the meta tag.

## HTML Examples

### ❌ Incorrect: legacy encoding

```html
<!DOCTYPE html>
<html lang="fr">
  <head>
    <meta charset="iso-8859-15">
    <title>Mon site</title>
  </head>
  <body>
    <p>Bienvenue sur mon site € 2025</p>
  </body>
</html>
```

### ✅ Correct: UTF-8 encoding

```html
<!DOCTYPE html>
<html lang="fr">
  <head>
    <meta charset="utf-8">
    <title>Mon site</title>
  </head>
  <body>
    <p>Bienvenue sur mon site € 2025</p>
  </body>
</html>
```

If you're using an Apache server, update your `.htaccess` or server config:

```
AddDefaultCharset UTF-8
```

For Nginx, update the server block:

```
charset utf-8;
```
