title: JSP wrong page encoding error. Tomcat Server
body: <p>I am trying to put some internationalization in my web page. But i faced with following exception: <strong><em>HTTP Status 500 - /patient/login.jsp (line: 8, column: 1) Page-encoding specified in XML prolog (UTF-16BE) is different from that specified in page directive (UTF-8)</em></strong></p>
  
  <p>Where is placed XML file that this error telling about?
  I have set UTF-8 encoding in my servlet, in page directive, also have an encoding filter. But still get this error....</p>
  
  <p>It show ok when i delete the <strong><em>&lt;%@page pageEncoding="UTF-8" %></em></strong> but then
  , when i choose russian language it gives me trash(Knowing that russian needs UTF-8)</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;%--
    Created by IntelliJ IDEA.
    User: User
    Date: 21.05.2016
    Time: 11:49
    To change this template use File | Settings | File Templates.
  --%&gt;
  &lt;%@page pageEncoding="UTF-8" %&gt;
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;
  &lt;%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %&gt;
  &lt;c:set var="language" value="${not empty param.language ? param.language : not empty language ? language : pageContext.request.locale}" scope="session" /&gt;
  &lt;fmt:setLocale value="${language}" scope="session"/&gt;
  &lt;fmt:setBundle basename="by.epam.i18n.text" /&gt;
  &lt;html lang="${language}"&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form&gt;
    &lt;select id="language" name="language" onchange="submit()"&gt;
      &lt;option value="en" ${language == 'en' ? 'selected' : ''}&gt;English&lt;/option&gt;
      &lt;option value="ru" ${language == 'ru' ? 'selected' : ''}&gt;Русский&lt;/option&gt;
      &lt;option value="es" ${language == 'es' ? 'selected' : ''}&gt;Español&lt;/option&gt;
    &lt;/select&gt;
  &lt;/form&gt;
    &lt;form method="post" action="account"&gt;
      &lt;table cellpadding="2" cellspacing="2"&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;label for="username"&gt;&lt;fmt:message key="login.label.username" /&gt;: &lt;/label&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="username" id="username"&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;label for="password"&gt;&lt;fmt:message key="login.label.password"&gt;&lt;/fmt:message&gt; &lt;/label&gt;: &lt;/td&gt;
          &lt;td&gt;&lt;input type="password" name="password" id="password"&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;/td&gt;
          &lt;fmt:message key="login.button.submit" var="buttonValue" /&gt;
          &lt;td&gt;&lt;input type="submit" value="${buttonValue}"&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/form&gt;
    &lt;footer class="container-fluid text-center"&gt;
      &lt;p&gt;Online Store Copyright&lt;/p&gt;
      &lt;form class="form-inline"&gt;Get deals:
        &lt;input type="email" class="form-control" size="50" placeholder="Email Address"&gt;
        &lt;button type="button" class="btn btn-danger"&gt;Sign Up&lt;/button&gt;
      &lt;/form&gt;
    &lt;/footer&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>