1、1。通过iconv -l 命令查看,其支持的编码格式还不少,之间可以互相转换
2、2 转换gbk编码文件为utf-8编码文件简洁命令:iconv -f gbk -t utf-8 index.html > aautf8.html其中-f指的是原始文件编码,-t是输出编码 index.html 是原始文件 aautf8.html是输出结果文件
3、3转换gbk编码文件为utf-8编码文件详细命令:iconv -c --verbose -f gbk -t utf-8 index.html -o index_utf8.html-c 指的是从输出中忽略无效的字符,--verbose指的是打印进度信息 -o是输出文件
4、4. 转换utf-8编码文件为gb2312编码文件详细命令:iconv -c --verbose -f utf-8 -t gb2312 index_utf8.html -o index_gb2312.html
5、5 php中iconv函数使用方法,iconv函数库能够完成各种字符集间的转换,是php编程中不可缺少的基础函数库1.首先下载libiconv函数库2、解压缩tar-zxvflibiconv-1.9.2.tar.gz3、安装libiconv configure--prefix=/usr/local/iconv make makeinstall4、重新编译php增加编译参数--with-iconv=/usr/local/iconv结果:iconv被安装到/usr/local/目录中