解决Goland的中文乱码问题
# 解决Goland的中文乱码问题
编辑器配置:
goland JVM配置:
在 Help
-> Edit Custom VM Options
添加
-Dfile.encoding=UTF8
1
另外,还推荐使用editorconfig (opens new window)来为整个项目进行配置:在项目根目录下添加:.editorconfig
,内容可以大致如下:
# http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
[*.yaml]
indent_size = 2
[*.yml]
indent_size = 2
[*.xml]
indent_size = 2
max_line_length = 1000
[*.json]
indent_size = 2
max_line_length = 1000
# https://github.com/Dreamscapes/makefiles/blob/master/.editorconfig
[{Makefile,**.mk}]
indent_style = tab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
提示
Jetbrains (opens new window)家的其他编辑器应该也一样