IDE 的 text file encoding 设置为 UTF-8; IDE 中文件的换行符使用 Unix 格式,不要使用 Windows 格式。

1.打开idea-Settings...

 2.搜索 file encodings

设置Encoding为UTF-8 

2.搜索 code style

设置换行符编码格式为Unix