Home > Backend Development > PHP Tutorial > 中文乱码 - 请问PHP中怎么将UTF-8字符串转化为ANSI编码

中文乱码 - 请问PHP中怎么将UTF-8字符串转化为ANSI编码

WBOY
Release: 2016-06-06 20:40:06
Original
2419 people have browsed it

主要是保存文件时,系统貌似只能接受ANSI的中文,可是
iconv();
mb_convert_encoding();
好像都不能直接转化的。。
据说WINDOWS系统默认文件名是ANSI,但是我页面设置的是UTF8,选择文件上传也没出现乱码啊

回复内容:

主要是保存文件时,系统貌似只能接受ANSI的中文,可是
iconv();
mb_convert_encoding();
好像都不能直接转化的。。
据说WINDOWS系统默认文件名是ANSI,但是我页面设置的是UTF8,选择文件上传也没出现乱码啊

<code>$name = iconv('utf-8','gb2312',$file['name']); //利用Iconv函数对文件名进行重新编码
</code>
Copy after login

http://www.jb51.net/article/42660.htm
试过了吗

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template