Chinese garbage problem solving IntelliJ IDEA Console

If the log4j set the output encoding is utf-8, but printed to the console is Chinese garbled, you can try the first workaround. I read a lot online, and finally resolved. Gather

Figure:                             

If one change does not work, you can try a variety of changes.

1: Open intelliidea installation path, IntelliJIDEA15.0.6 \ bin find idea.exe.vmoption file, open, filling in the last line: "- Dfile.encoding = UTF-. 8 ", as shown, to save.

2: Set idea file encoding. In the menu bar to find "File-> settings-> Search File Encodeing" set utf-8. as the picture shows

 

3: coding setting idea server. Found "run-> editconfigration" in the menu bar to find the "server" tab settings vm option to -Dfile.encoding = utf-8, as shown in (I pro-test is very effective) 3

 

success:

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

New solutions and source the comments section 4 netizens single Zhao Si, sexy grass era of artificial intelligence, Mr.dadong 

HELP->Edit Custom VM OPtions中加 -Dfile.encoding=utf-8       重启idea
  
  

 

 

 

 

 

 

 

 

 

                        <li class="tool-item tool-active is-like "><a href="javascript:;"><svg class="icon" aria-hidden="true">
                            <use xlink:href="#csdnc-thumbsup"></use>
                        </svg><span class="name">点赞</span>
                        <span class="count">22</span>
                        </a></li>
                        <li class="tool-item tool-active is-collection "><a href="javascript:;" data-report-click="{&quot;mod&quot;:&quot;popu_824&quot;}"><svg class="icon" aria-hidden="true">
                            <use xlink:href="#icon-csdnc-Collection-G"></use>
                        </svg><span class="name">收藏</span></a></li>
                        <li class="tool-item tool-active is-share"><a href="javascript:;"><svg class="icon" aria-hidden="true">
                            <use xlink:href="#icon-csdnc-fenxiang"></use>
                        </svg>分享</a></li>
                        <!--打赏开始-->
                                                <!--打赏结束-->
                                                <li class="tool-item tool-more">
                            <a>
                            <svg t="1575545411852" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5717" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M179.176 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5718"></path><path d="M509.684 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5719"></path><path d="M846.175 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5720"></path></svg>
                            </a>
                            <ul class="more-box">
                                <li class="item"><a class="article-report">文章举报</a></li>
                            </ul>
                        </li>
                                            </ul>
                </div>
                            </div>
            <div class="person-messagebox">
                <div class="left-message"><a href="https://blog.csdn.net/qq_39136928">
                    <img src="https://profile.csdnimg.cn/9/9/1/3_qq_39136928" class="avatar_pic" username="qq_39136928">
                                            <img src="https://g.csdnimg.cn/static/user-reg-year/2x/3.png" class="user-years">
                                    </a></div>
                <div class="middle-message">
                                        <div class="title"><span class="tit"><a href="https://blog.csdn.net/qq_39136928" data-report-click="{&quot;mod&quot;:&quot;popu_379&quot;}" target="_blank">潘丶</a></span>
                                            </div>
                    <div class="text"><span>发布了93 篇原创文章</span> · <span>获赞 71</span> · <span>访问量 15万+</span></div>
                </div>
                                <div class="right-message">
                                            <a href="https://im.csdn.net/im/main.html?userName=qq_39136928" target="_blank" class="btn btn-sm btn-red-hollow bt-button personal-letter">私信
                        </a>
                                                            <a class="btn btn-sm  bt-button personal-watch" data-report-click="{&quot;mod&quot;:&quot;popu_379&quot;}">关注</a>
                                    </div>
                            </div>
                    </div>
    
Published 45 original articles · won praise 0 · Views 3541

如果log4j设置输出编码是utf-8,但是打印到控制台的是中文乱码,可以尝试第一个解决方法。 看了很多网上的,终于解决了。汇总

Guess you like

Origin blog.csdn.net/qq_44813090/article/details/104202473