捷克语字符编码在PHP中 [英] Czech characters encoding in PHP
本文介绍了捷克语字符编码在PHP中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要编写一个解析.htm文件的脚本。
这些.htm文件来自捷克网站,当在记事本中打开文件时,我可以看到例如:Číslo
I need to make a script which parse .htm files. These .htm files are from a czech website and when opening the file in Notepad, I can see for example the word : Číslo
我首先导入源文件代码为字符串:
I first import the source code into a string :
mb_internal_encoding("UTF-8");
$content = file_get_contents($filename);
然后我尝试在其中找到Číslo:
Then I try to find Číslo in it :
$str_init = "Číslo";
$init = mb_strpos($content, $str_init) ;
$ init返回FALSE ...
$init returns FALSE...
任何想法?
推荐答案
保存您的PHP文件与
BOM。
Save your PHP file with
the BOM.
这篇关于捷克语字符编码在PHP中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文