我有一个txt文件(文件编码在ANSI根据notepad++),其中有'…'。我正在逐行读取文件,我想将…
替换为...
我所做的一切似乎都失败了
-
$str = htmlentities($str); # trying to convert to … as I can deal with this
-
$str = mb_ereg_replace("…","...",$str);
-
$str = str_replace("…", "...", $str);
以上都不起作用!我错过了什么,我该如何解决这个问题?
注意:我的php脚本,试图解决这个问题是在UTF8编码和php头是UTF8
提前感谢您的帮助!
正如您所说的,它是用字节0x85
在文件中表示的,试试这个:
$str = str_replace("x85", "...", $str);