PHPStorm里面GBK编码的文件改成UTF-8编码方法

如果在PHPStorm里面GBK编码文件直接把编码格式改成UTF-8的话,中文会乱码。

一、有一个比较简单的办法就是用Sublime Text编辑器打开文件

二、然后点击 :文件->保存编码->UTF-8,(注意:如果不操作这步,会报错误:Namespace declaration statement has to be the very first statement or after)。文件另存为就可以了。

 

三、然后在PHPStorm里面打开就变成UTF-8的编码的了。

posted @ 2021-11-17 17:06  mayzhen  阅读(430)  评论(0)    收藏  举报