Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chinese messy code #582

Open
siyongshuai opened this issue Mar 2, 2016 · 14 comments
Open

chinese messy code #582

siyongshuai opened this issue Mar 2, 2016 · 14 comments

Comments

@siyongshuai
Copy link

chinese messy code

right

babun version is 1.2.0-dist
my os is windows 7 chinese version
how to fix this problem

@ygxxii
Copy link

ygxxii commented Jun 26, 2016

These is a way to fix this .

default

Add | iconv -f GBK -t UTF8 after the CMD command.

2

Cause Windows CMD use GBK but babun use UTF8.
Maybe you can create alias for convence.

@igofind
Copy link

igofind commented Aug 20, 2016

Try this. vim ~/.babunrc and change LANG, LC_TYPE, LC_ALL all three local-config to zh_CN.GBK.

@genghis-yang
Copy link

I resolved it by changing windows code page.
I add chcp 65001 into ~/.bahunrc and the problem go away.

@vipzrx
Copy link

vipzrx commented Mar 20, 2017

@yangcheng2503
~/.bahunrc 这个拼写错了 是 C:\Users\kk.babun\cygwin\home\kk.babunrc

在 .babunrc 中 怎么添加 chcp 65001 ,麻烦写出具体的语句,谢谢!

@QIEXXII 你提到的命令别名,该怎么写呢?

@vipzrx
Copy link

vipzrx commented Mar 20, 2017

C:\Users\kk.babun\cygwin\home\kk.babunrc 中末尾加上

chcp 65001

输出的命令就会英文显示
20170320_200450

window下显示的是中文的
20170320_200542

@vipzrx
Copy link

vipzrx commented Mar 20, 2017

20170320_201048

还是会有乱码

@Shangyunliang
Copy link

Shangyunliang commented May 13, 2017

... Dose anybody resolve it ?

@erleizh
Copy link

erleizh commented Jan 7, 2018

方案一:

#改变控制台编码为UTF-8 , 以便支持中文
chcp 65001 > /dev/null

此方法可能需要伴随着改字体... 不一定有效

方案二:
添加别名到 .zshrc (我用的 zsh)

alias utf8="iconv -f GBK -t UTF8"

然后使用
ipconfig | utf8

@piumnl
Copy link

piumnl commented Mar 11, 2018

@lll-01 我尝试了 java | utf8 ,依旧是乱码

@erleizh
Copy link

erleizh commented Mar 12, 2018

@erleizh
Copy link

erleizh commented Mar 12, 2018

@piumnl 确实无效 , iconv 貌似没有用

@piumnl
Copy link

piumnl commented Mar 13, 2018

@lll-01 java -Dfile.encoding=utf8 可以解决中文乱码的问题,但是其他如 javac 的命令就不知道该如何处理了,-D的命令是 jvm 拥有的,javac 这种命令没有暴露对其 jvm 参数的操作。

@piumnl
Copy link

piumnl commented Mar 13, 2018

终究不是一个非常好的处理方法,希望还是可以在源头 babun 上解决吧。

@gaunthan
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants