php和希腊字符

php和希腊字符,php,utf-8,Php,Utf 8,我有一个脚本,它从HTML表单中获取Fname。当我插入希腊字符时,文件夹的名称在Windows资源管理器中用符号显示。为什么会发生这种情况?我能做些什么来解决这个问题 $folderStr = $_REQUEST['FName']; //create SEO firndly directory name $upload_folder = preg_replace ("'\s+'", '-', $folderStr); // The place the files will be up

我有一个脚本,它从HTML表单中获取
Fname
。当我插入希腊字符时,文件夹的名称在Windows资源管理器中用符号显示。为什么会发生这种情况?我能做些什么来解决这个问题

$folderStr = $_REQUEST['FName'];

//create SEO firndly directory name
$upload_folder =    preg_replace ("'\s+'", '-', $folderStr);

// The place the files will be uploaded to (currently a 'files' directory).
 $upload_path = './uploads/'.$upload_folder.'/';

//Check whether folder exists or create with the name supplied

if(is_dir($upload_path))
echo 'directory exists';
else
mkdir ('./uploads/'.$upload_folder.'/', 777);

确保您提交的表单是utf-8编码的

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

确保您提交的表单是utf-8编码的

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


这不是一个真正的Windows文件系统问题,可能是由PHP输出的内容引起的吗?在处理PHP时,我通常避免在文件夹名或URL中使用非ASCII字符。我有一组替换函数,即将ƒ转换为f。显然,Windows NTFS使用(向下滚动到Windows部分)。我应该向代码中添加什么,以便将非ASCII字符编码为UTF-16?$filename=iconv(“UTF-8”、“UTF-16LE//IGNORE”、$input_string);这不是一个真正的Windows文件系统问题,可能是由PHP输出引起的吗?在处理PHP时,我通常避免在文件夹名或URL中使用非ASCII字符。我有一组替换函数,即将ƒ转换为f。显然,Windows NTFS使用(向下滚动到Windows部分)。我应该向代码中添加什么,以便将非ASCII字符编码为UTF-16?$filename=iconv(“UTF-8”、“UTF-16LE//IGNORE”、$input_string);