title: JSP not showing correct UTF-8 contents for HTML form POST
body: <p>I'm using Java 11 with Tomcat 9 with the latest JSP/JSTL. I'm testing in Chrome 71 and Firefox 64.0 on Windows 10. I have the following test document:</p>
  
  <pre><code>&lt;%@ page contentType="text/html; charset=UTF-8" %&gt;
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en-US"&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"/&gt;
    &lt;title&gt;Hello&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;c:if test="${not empty param.fullName}"&gt;
      &lt;p&gt;Hello, ${param.fullName}.&lt;/p&gt;
    &lt;/c:if&gt;
  
    &lt;form&gt;
      &lt;div&gt;
        &lt;label&gt;Full name: &lt;input name="fullName" /&gt;&lt;/label&gt;
      &lt;/div&gt;
      &lt;button&gt;Say Hello&lt;/button&gt;
    &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is perhaps the simplest form possible. As you know the form <code>method</code> defaults to <code>get</code>, the form <code>action</code> defaults to <code>""</code> (submitting to the same page), and the form <code>enctype</code> defaults to <code>application/x-www-form-urlencoded</code>.</p>
  
  <p>If I enter the name "Flávio José" (a famous Brazilian forró singer and musícian) in the field and submit, the form is submitted via HTTP <code>GET</code> to the same page using <code>hello.jsp?fullName=Fl%C3%A1vio+Jos%C3%A9</code>. This is correct, and the page says:</p>
  
  <pre><code>Hello, Flávio José.
  </code></pre>
  
  <p>If I change the form <code>method</code> to <code>post</code> and enter the same name "Flávio José", the form contents are instead submitted via <code>POST</code>, with HTTP request contents:</p>
  
  <pre><code>fullName=Fl%C3%A1vio+Jos%C3%A9
  </code></pre>
  
  <p>This also appears correct. But this time the page says:</p>
  
  <pre><code>Hello, FlÃ¡vio JosÃ©.
  </code></pre>
  
  <p>Rather than seeing <code>%C3%A</code> as a sequence of UTF-8 octects, JSP seems to think that these are a series of ISO-8859-1 octets (or code page 1252 octets), and is therefore decoding them to the wrong character sequence.</p>
  
  <p>But where is it getting ISO-8859-1? What is my JSP page lacking to indicate the correct encoding?</p>
  
  <p>I'll note also that <a href="https://url.spec.whatwg.org/#urlencoded-parsing" rel="nofollow noreferrer">WHATWG specification</a> says that <code>application/x-www-form-urlencoded</code> octets should be parsed as UTF-8 by default. Is the Java servlet specification simply broken? How do I work around this?</p>