<div dir="ltr">Hi,<div><br></div><div>I am using Username Password login handler. But if the username contain non-ASCII characters it will fail. Somehow the encoding messed up the string.</div><div><br></div><div>What I have done is in login.jsp, add the following line:</div>

<div><div>&lt;%@ page contentType=&quot;text/html;charset=UTF-8&quot; pageEncoding=&quot;UTF-8&quot;%&gt;</div><div>That means my response is UTF-8 encoded, and also tells browser to encode in UTF-8 when posting request to server.</div>

<div><br></div><div>But in Shibboleth IdP side, when it retrieves the parameter in UsernamePasswordLoginServlet.java, it doesn&#39;t set the correct encoding using:</div><div>request.setCharacterEncoding(&quot;UTF-8&quot;);</div>

<div><br></div><div>It just call request.getParameter(..), which will decode in default &quot;ISO-885901-1&quot;.</div><div><br></div><div>Then when my JAAS module gets the username it is already messed up. I have to manually convert the string to UTF-8 manually like:</div>

<div>String correctUsername =  new String(username.getBytes(&quot;iso-8859-1&quot;), &quot;UTF-8&quot;);<br></div><div><br></div><div>Changing the UsernamePasswordLoginServlet.java source code is not what I want to do either.</div>

<div><br></div><div>Is there any better way to resolve this? </div><div><br></div><div>Thanks,</div><div>Yaowen</div>
</div></div>