In my Application I made it to have it in two languages. English and French.
In English, its all right. But while Reading the Properties file for French Language it ends up showing mojibake.
I have in my properties file like this:
example.french.char=é
but it does not show properly in the application. I am viewing my app in Windows. I dont want to replace the French characters by Unicode characters. I want them to be read from properties file as they normally appear.
How can I make it work? Please suggest. Can I make it happen to view the French Characters without using Unicodes?
My properties file is encoded in UTF-8. Please suggest!
I tried the following too..
public class CharacterEncodingFilter implements Filter{
private FilterConfig config;
@Override
public void destroy() {
setConfig(null);
}
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain filter) throws IOException, ServletException {
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
filter.doFilter(request, response);
}
@Override
public void init(FilterConfig config) throws ServletException {
setConfig(config);
}
public FilterConfig getConfig() {
return config;
}
public void setConfig(FilterConfig config) {
this.config = config;
}
}
and added this in web.xml
<filter>
<filter-name>charEncoding_Filter</filter-name>
<filter-class>com.edfx.tum.filter.CharacterEncodingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>charEncoding_Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
but still it shows mojibake.