title: Passing request parameters as UTF-8 encoded strings
body: <p>I am creating a simple login page and I want to pass login and password parameters as UTF-8 encoded strings. As you can see in the code below, the first line is where I set encoding to UTF-8, but it seems this is pointless because it doesn't work. When I use login and password parameters with accents the result page receives strange characters.</p>
  
  <p>How to set character encoding correctly in a way that works in all browsers?</p>
  
  <pre><code>&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;My Page&lt;/title&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;h1&gt;Welcome to My Page&lt;/h1&gt;
  
          &lt;form name="login" action="login.jsp" method="POST"&gt;
              Login:&lt;br/&gt;
              &lt;input type="text" name="login" value="" /&gt;&lt;br/&gt;
              Password:&lt;br/&gt;
              &lt;input type="password" name="password" value="" /&gt;&lt;br/&gt;
              &lt;br/&gt;
              &lt;input type="submit" value="Login" /&gt;&lt;br/&gt;
          &lt;/form&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>