How to fix: Bad value text/html; charset=utf-8 for attribute content on element meta: utf-8 is not a valid character encoding name.

Most Likely Cause and Fix

In the context of <meta content="text/html; charset=utf-8" /> the attribute content is not allowed to take the value text/html; charset=utf-8.

You should remove this attribute or set a valid value for your markup to be considered valid.

What This Error Means

Some element attributes can take pretty much any value, others can take only values of a certain type and others still can only take a value from a pre-defined set.

This error relates to the following usage in your markup:

<meta content="text/html; charset=utf-8">

The error is stating that, in this context, the attribute content on element meta is not allowed to take the value text/html; charset=utf-8

The validator is giving the reason: utf-8 is not a valid character encoding name.

How To Fix It

The error relates to an invalid attribute value being used on a specific element.

How this might be fixed often depends on the element, attribute, attribute value and the context in which these are being used.

Pay attention to the additional information supplied by the HTML validator as this will often point you in the right direction: utf-8 is not a valid character encoding name.

In general

Change the relevant attribute value to one that is valid for the context in which it is being used.

Discuss, Comment and Improve

Did this help you? Can this page be improved? Let us know!

comments powered by Disqus