PHP使用文本编码


PHP working with text encoding

我正在开发Facebook公共搜索API。

正如你所理解的,我得到的结果来自世界的许多不同方面。

我要做的是在将所有文本放入我的MongoDB之前,给它们提供相同的文本编码。我需要使用UFT8作为通用和工作编码。

这是我可能从Facebook上得到的一个例子:

10 ผู้นำที่โลà¸à¹„ม่ปรารถนา หาà¸à¹„ม่มีผู้นำประเภทนี้à¹à¸¥à¹‰à¸§à¹‚ลà¸à¹€à¸£à¸²à¸à¹‡à¸ˆà¸°à¸”ีขึ้นเยอะ โดยไทยติดอันดับ 1 อ่านต่อได้ที่นี่

Now he says he’d side with Pakistan if there were a conflict with the U.S. Better than the Taliban for sure, but not by much. The poor people of Afghanistan… Ayman al-Zawahiri: Al-Qaeda’

€™esercito tedesco, il primo modello di A400M è in fase di collaudo, e ci resterà  per tre anni

PHP中是否有一个函数可以快速将文本转换为UFT8文本编码?

你试过这个函数吗?

http://php.net/manual/en/function.utf8-encode.php