I am currently using the jQuery-File-Upload. I may upload some files with a Japanese or Chinese file name, and I can see that the file name is for example, \"お疲れ様です.txt\" or \"测
As Stephen C said a filter can be used to get the right encoding. We had this problem on JBOSS 7.1.1 and implemented a filter.
In web xml
set character encoding
RequestEncodingFilter
com.myapp.RequestEncodingFilter
encoding
UTF-8
RequestEncodingFilter
/*
Filter class:
public class RequestEncodingFilter implements Filter {
private static final String ENCODING = "encoding";
private String configuredEncoding;
@Override
public void init(FilterConfig filterConfig) throws ServletException {
configuredEncoding = filterConfig.getInitParameter(ENCODING);
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
servletRequest.setCharacterEncoding(configuredEncoding);
filterChain.doFilter(servletRequest, servletResponse);
}
@Override
public void destroy() {
}
}