Tomcat 9.0.59 added a charset mapping for Japanese to default to Shift_JIS encoding.

This results in corrupted rendering if the client expects UTF-8 and can be easily seen by setting the Accept-Language: ja header (by changing the primary language in Chrome settings to Japanese).

The fix is to apply the same override mapping in TomcatServletWebServerFactory.java that already existed for en and fr (in those cases, to override ISO-8559-1 to UTF-8):

index.html:

<!DOCTYPE html>
<html lang="ja">
<head>
  <meta charset="UTF-8">
  <title>こんにちは世界</title> <!-- "Hello, World" -->
</head>
<body>
管理者画面 <!-- "Admin" -->
</body>
</html>

Comment From: snicoll

@chrisrhut thank you for the PR. I've removed the screenshots as I believe they're adding noise to the report.

Comment From: mhalbritter

Thanks for your contribution, i merged it.