the scenario is like this :
datepicker jquery ui in french needs the page to be encoded iso (because with utf , there are some french character that are not well displayed)
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
and i have some arabic data that i need to store in the database, for this the page must be encoded in utf_8
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
data is sent via ajax
what to do ?
In this situation I believe you should always publish with UTF-8. But you need to make sure that all declared encodings agree. For example, for HTML, any encoding declared in a
<meta>tag should agree with the actualContent-typeHTTP header.The only reason I can think of to publish in ISO-8859-1 instead of UTF-8 is if you have a client that you cannot change that requires this encoding. But even in that case, hopefully you would be able to use a
User-Agentrequest header to identify this client and serve ISO-8859-1 only to that client.