# Bad value “text/html;” for attribute “content” on element “meta”: The legacy encoding declaration ended prematurely.

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-text-html-semicolon-for-attribute-content-on-element-meta-the-legacy-encoding-declaration-ended-prematurely
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `content` attribute of a `<meta http-equiv="Content-Type">` tag ends at `text/html;`, with no character encoding after the semicolon.

With `http-equiv="Content-Type"`, the `<meta>` element is an encoding declaration, and the HTML standard allows one shape for its `content`: `text/html;`, optional spaces, then `charset=utf-8`. The validator reads `text/html;`, hits the end of the value right after the semicolon, and reports that the declaration ended too early. Values cut off later get different messages: `text/html; charset` is reported as missing `charset=`, and `text/html; charset=` as an empty encoding name.

Browsers take an encoding from this tag only when they find `charset=` in it, so a bare `text/html;` does nothing. If the server's `Content-Type` header has no charset either, the browser falls back to its own default, and accented letters or symbols can come out garbled.

Add `charset=utf-8` after the semicolon, or swap the tag for the shorter `<meta charset="utf-8">`, which declares the same thing. Keep only one of the two forms in the document. The file itself also has to be saved as UTF-8.

## Invalid example

```html
<head>
  <meta http-equiv="Content-Type" content="text/html;">
  <title>Products</title>
</head>
```

## Valid example

```html
<head>
  <meta charset="utf-8">
  <title>Products</title>
</head>
```
