开发者

Strange characters and encoding while using twitter API

I begun developing my own SIMPLE twitter client in my server (to bypass twitter.com blocking rule stablished by some dumbass at govt. office)

Please check this image so you can 开发者_运维技巧see the accented characters converted into weird symbol:

Strange characters and encoding while using twitter API

It is being developed with this class Twitter PHP class by Tijs Verkoyen

This is my heading code, which is utf-8. Can anyone point me to a fix?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

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

<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>


try using the utf8_encode() function with PHP


best is to avoid hassle if you could pass all your twitter texts(i.e. twitter API delivers JSON format too) using some sort of JSON format and pass those JSON into PHP 5 function

json_decode(jsonStr);

json_decode automatically converts to utf8 encoding which can save you from writing extra code for character encoding..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜