Solve the problem of idea+tomcat9 console garbled and js file parsing garbled

Idea+tomcat9 console garbled and js file parsing garbled

  1. Garbled characters on the idea editing page --------
    solution: modify the idea configuration File-->Settings--> Editor -- >File Encodings
    Insert picture description here

  2. When the project is running, Chinese garbled characters appear in the parsing of the js file (this situation is that the idea editing page is normal, and the parsing appears garbled after running with tomcat): as shown in the figure ------
    Insert picture description here
    Solution: Add in VM options: -Dfile.encoding= utf-8
    Insert picture description here

  3. Idea console garbled problem -----
    Insert picture description here
    This kind of garbled is a tomcat problem. Modify the logging.properties file in the tomcat conf directory and set the following items to UTF-8.
    Insert picture description here
    Then modify the idea configuration: Help–>Edit Custom VM Options–>Add in the last line of the opened file: -Dfile.encoding=utf-8
    Insert picture description here
    Insert picture description here

  4. Finally, if it still doesn’t work, you can try to comment or delete these lines in the logging.properties file in the tomcat conf directory.
    Insert picture description here
    This pit is my first time using idea+tomcat9. If the above methods are not working, please check the specific reason and modify it. Related configuration

Guess you like

Origin blog.csdn.net/weixin_46909756/article/details/108407027