转: 解决MSYS2下的中文乱码问题

解决方案

新建/usr/bin/win

1
2
#!/bin/bash
$@ |iconv -f gbk -t utf-8

新建/etc/profile.d/alias.sh

1
2
3
4
5
6
7
8
alias ls="/bin/ls --color=tty --show-control-chars"
alias grep="/bin/grep --color"
alias ll="/bin/ls --color=tty --show-control-chars -l"

alias ping="/bin/win ping"
alias netstat="/bin/win netstat"
alias nslookup="/bin/win nslookup"
alias ipconfig="/bin/win ipconfig"

对了,改完以后需要重启一下 msys2 ,不然还是会乱码。

参考: http://kc123kc.github.io/2015/12/24/How-To-Solve-Gibberish-Problem-Under-MSYS2/ 

原文地址:https://www.cnblogs.com/smallrookie/p/msys2.html