0

It seems so difficult to understand, my web application is incorrect encoding in some places where use the bootstrap's plugin: dataTables, but others are correct. Like this image

I have already done something set tomcat's VM option -Dfile.encoding=UTF-8, which can solve this problem. However, the console output is incorrect.

In actually, I have referenced the solutions in StackOverflow. For example, from this link

  1. Set -Dfile.encoding=UTF-8 and -Dfile.encoding=UTF-8 in both idea.exe.vmoptions and idea64.exe.vmoptions.

  2. Changed Settings > Editor > File encodings IDE Encoding/Project Encoding/Default encoding for property files to UTF-8.

  3. Set tomcat's VM option -Dconsole.encoding=UTF-8 instead of -Dfile.encoding=UTF-8. Year, console output is correct, but JSP is not.

Making the console output and JSP display correct encoding at the same time is so difficult. It has confused me a long time.

Thanks in advance for your help

rimonmostafiz
  • 1,341
  • 1
  • 15
  • 33
yangchenxi
  • 21
  • 4
  • 1
    The jvm options you set fir IDE itself (in exe.vmoptions file) has no relation to how your application handles the encoding. Check e.g. https://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q8 – Andrey Jan 08 '19 at 12:45
  • Dear Andrey, because I don't have 50 rep, so only reply to you by this way, sorry.That's a good idea, thanks! I notice that my jsp import js which contain some Chinese character, in such situation, the jsp is incorrect encoding. With the help of your website, I understand that the incorrect encoding is caused by tomcat.But so far I can't solve this problem. – yangchenxi Jan 09 '19 at 09:03

0 Answers0