[jboss-jira] [JBoss JIRA] (WFLY-8358) Wrong charset received in HttpServletRequest sent by POST method with JQUERY AJAX

Mario García García (JIRA) issues at jboss.org
Wed Mar 15 03:21:00 EDT 2017


    [ https://issues.jboss.org/browse/WFLY-8358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13377900#comment-13377900 ] 

Mario García García commented on WFLY-8358:
-------------------------------------------

I forgot to mention that the same code works fine in jboss-as-7.1.1.Final.
By the way, I tried to attach the source code but JIRA didn't allow me. I am trying again attaching the code to this comment.

 [^MiServlet.java] 
 [^index.jsp] 

> Wrong charset received in HttpServletRequest sent by POST method with JQUERY AJAX
> ---------------------------------------------------------------------------------
>
>                 Key: WFLY-8358
>                 URL: https://issues.jboss.org/browse/WFLY-8358
>             Project: WildFly
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 10.1.0.Final
>         Environment: Tested in Windows 7 Enterprise and tested in Linux 3.16.6-2-desktop
>            Reporter: Mario García García
>            Assignee: Jason Greene
>         Attachments: MiServlet.java, index.jsp
>
>
> Performing a typical AJAX call with JQUERY ($.ajax function) to a Servlet from a JSP with method POST and sending a parameter that contains a String with latin characters such as 'ó'.
> This is the String that is sent into a parameter:
> "Código"
> No content type specified so JQUERY.AJAX takes the default one (contentType: 'application/x-www-form-urlencoded, charset=UTF-8').
> The received parameter in HttpServletRequest (doPost method) is showed like this:
> "C??digo". 
> In Hex this is the content:
> 43 3f3f 6469676f (spaces added for better reading pourposes)
> This is no UTF-8. The proper encoding should be:
> 43 c3b3 6469676f (spaces added for better reading pourposes)
> Wildfly Configuration:
> Subsystems    Subsystem: Web/HTTP - Undertow    Settings: Servlet/JSP
> Default encoding: (empty)
> Java encoding: UTF8
> Subsystems    Subsystem: Web/HTTP - Undertow    Settings: HTTP
> Url charset: UTF-8



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)



More information about the jboss-jira mailing list