3 回答

TA贡献1934条经验 获得超2个赞
这meta无效:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
因为网络服务器已经发送了Content-Type标头,因此决定了编码方式。Web浏览器以相同的编码发送表单。meta当用户离线时,此功能很有用。
因此,您必须Content-Type自己设置sned HTTP标头:
<?php header("Content-Type: text/html; charset=utf-8"); ?>
确保将其放在任何HTML,内容或任何发送的内容之前。
另外,accept-charset标记form应可正常工作:
<form accept-charset="utf-8">

TA贡献1852条经验 获得超7个赞
到目前为止,我发现的唯一解决方案 ..(2014年):
1)我没有以UTF-8字符串在FTP上存储文件。相反,我使用此功能来重命名上传的文件:
<?php
// use your custom function.. for example, utf8_encode
$newname = utf8_encode($_FILES["uploadFile"]["name"]);
move_uploaded_file($_FILES["uploadFile"]["tmp_name"], $newname);
?>
2)现在您可以重命名(或其他)$newname;
- 3 回答
- 0 关注
- 310 浏览
添加回答
举报