Skip to main content
HTML Validation

Legacy encoding “shift_jis” used. Documents must use UTF-8.

About This HTML Issue

All HTML documents must use UTF-8 character encoding. The shift_jis encoding is a legacy Japanese encoding that is no longer valid in modern HTML.

The HTML specification requires UTF-8 as the only permitted character encoding for HTML documents. This rule applies regardless of the document's language or the characters it contains. Legacy encodings like shift_jis, euc-jp, iso-8859-1, and others are not allowed.

To fix this, two things need to happen. First, the <meta> charset declaration must specify UTF-8. Second, the file itself must actually be saved with UTF-8 encoding. Declaring UTF-8 in the markup while the file is saved as Shift_JIS will cause garbled text (mojibake). Most modern text editors and IDEs (VS Code, Sublime Text, Notepad++) can convert a file's encoding through a "Save with Encoding" or "Reopen with Encoding" option.

If a server sends a Content-Type header with charset=shift_jis, that header also needs to be updated to charset=utf-8. The HTTP header takes precedence over the <meta> tag, so fixing only the HTML is not enough if the server overrides it.

HTML examples

Before (invalid)

<!doctype html>
<html lang="ja">
  <head>
    <meta charset="shift_jis">
    <title>Example</title>
  </head>
  <body>
    <p>日本語のテキスト</p>
  </body>
</html>

After (valid)

<!doctype html>
<html lang="ja">
  <head>
    <meta charset="utf-8">
    <title>Example</title>
  </head>
  <body>
    <p>日本語のテキスト</p>
  </body>
</html>

Make sure the file is also saved as UTF-8 in your text editor. In VS Code, click the encoding label in the bottom status bar and select "Save with Encoding" then "UTF-8".

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
$7 / 7 days

Pro Trial

Full Pro access. Cancel anytime.

Start Pro Trial →

Join teams across 40+ countries