2012-02-07 55 views
0

我正在使用Facebook公共搜索API。PHP使用文本编码

正如你所了解的结果,我来世界各地的许多不同的方面。

我必须做的是给所有的文本,我把它放入我的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文本编码?

+1

是的,有几个。你会专门寻找'mb_'函数。 – 2012-02-07 19:15:55

+0

http://php.net/manual/en/function.mb-convert-encoding.php – Daan 2012-02-07 19:15:59

+0

@BrianDriscoll我试过了,但它不起作用。它不会在文本中转换任何内容。一切都保持不变。这是我所做的:$ post ['description'] [] = mb_convert_encoding($ v-> message,'UTF-8','auto'); – 2012-02-07 19:26:27

回答