进入服务器目录 [root@VM_139_218_centos /]# cd ~ [root@VM_139_218_centos ~]# vim .vimrc 在 .vimrc 文件中写入以下代码: set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936 set termencoding=utf-8 set encoding=utf-8 然后打开php文件,乱码消失,可以正常使用了.…
解决办法 使用GB2312中文字符集 StreamReader reader = new StreamReader(txtUrl, Encoding.GetEncoding("gb2312")); 或使用默认编码格式 StreamReader sR = new StreamReader(filePath, System.Text.Encoding.Default)…