Announcement Announcement Module
Collapse
No announcement yet.
Characters Encoding Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Characters Encoding

    Hi,

    Please i'm facing a problem with alphanumeric character such as , , from my inputs form

    here is my configuration

    pom.xml
    Code:
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    web.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
        					http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        				id="WebApp_ID" version="2.5">
     
      	
    	<display-name>Suivi Collaborateurs</display-name>
        <context-param>
    	    <param-name>contextConfigLocation</param-name>
    	    <param-value>
    	    	/WEB-INF/spring-servlet.xml,
    			/WEB-INF/applicationContext-security.xml      
    	    </param-value>
    	</context-param>
    	<listener>
    	    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    	<listener>
    	    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    	</listener>
    	<listener>
    	    <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
    	</listener>
     	<listener>
    	    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    	</listener>
    
        <filter>
            <filter-name>encoding-filter</filter-name>
            <filter-class>
                org.springframework.web.filter.CharacterEncodingFilter
            </filter-class>
            <init-param>
                <param-name>encoding</param-name>
                <param-value>UTF-8</param-value>
            </init-param>
            <init-param>
    	        <param-name>forceEncoding</param-name>
    	        <param-value>true</param-value>
    	    </init-param>
        </filter>
    
        <filter-mapping>
            <filter-name>encoding-filter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>

    Jsp Page head
    Code:
    <%@ page contentType="text/html;charset=utf-8" pageEncoding="utf-8" language="java" %>
    <%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
    <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@ taglib prefix="ckeditor" uri="http://ckeditor.com"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="shortcut icon" href="img/favicon.ico" type="image/vnd.microsoft.icon" />
    <link rel="stylesheet/less" type="text/css" href="css/suivicollaborateur.less" />
    <link href="css/ui-lightness/jquery-ui-1.10.1.custom.css" rel="stylesheet" />
    
    
    <script src="js/jquery-1.9.1.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="js/jquery.validate.min.js"></script>
    <script type="text/javascript" src="js/formulaireverif.js"></script>
    <script src="js/less.js" type="text/javascript"></script>
    <script src="js/jquery-ui.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/htmlentities.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.10.1.custom.js"></script>
    <script type="text/javascript" src="js/suivicollaborateur.js"></script>
    <script type="text/javascript" src="js/jquery.serializeObject.js"></script>
    <script type="text/javascript" src="js/json2.js"></script>
    <script type="text/javascript" src="js/transmissions.js"></script>
    
    <title> </title>
    
    
    </head>

    My Ajax request
    Code:
    $.ajax({
    		type: 'GET',
    		url:'enregistrer-mission.html',
    		dataType : 'json',
    		contentType: "application/x-www-form-urlencoded;charset=UTF-8",
    		data:{ fiche: JSON.stringify(donneesatransmettreenligne)},
    		success: function(data) {
    			
    			if(data=="true"){
    				
    				importerlesfichesduserveur();
    			}
    			
    			else
    				offlinestorage(donneesatransmettreenligne);	
    		},
    		error: function(data) { 
    			alert("Impossible de stocker en Ligne");
    			offlinestorage(donneesatransmettreenligne);
    		   
    		}
    	});
    with all this my alphanumeric characters are not encoded i expect to have something like replaced by &eacute;

    Please how to fix this issue

    Thanks
Working...
X