phpstorm配置git並解決Terminal 中文亂碼(Unicode 編碼)的方法

前言:在使用PHPstorm的時候,須要用到terminal,主要仍是用這個操做git,可是在使用這個的時候會發現,代碼裏全部中文都是亂碼狀態,不利於使用,下面就來看看怎麼解決這個問題php

 

1、先在phpstorm上配置githtml

一、打開 settings 設置界面,選擇 Tools 中的 Terminal (File -> settings -> Tools -> Terminal)git

二、修改 Shell path 爲你的Git bash 安裝路徑,個人在 D:\developer\Git\bin\bash.exebash

三、從新打開你的 Terminal 就能看到變成了常常看到的 Git bash 窗口phpstorm

 

2、解決中文 Unicode 編碼問題編碼

一、修改 Git 的安裝目錄下的 bash.bashrc 文件,個人目錄是:D:\developer\Git\etc,在該文件最後添加如下代碼spa

 

# 解決IDEA下的terminal中文Unicode編碼問題 export LANG="zh_CN.UTF-8" export LC_ALL="zh_CN.UTF-8"

 

二、添加之後重啓 IDEA,從新打開 Terminal 查看中文內容,就成功顯示中文啦code

原文出處:https://www.cnblogs.com/chenhaoyu/p/12217726.htmlorm

相關文章
相關標籤/搜索