/    Sign up×
Community /Pin to ProfileBookmark

Text Encoding ()

Ok i am using cURL to get information but the problem is sometimes it returns the data in chinese or japanese(not sure), i was returning this information using Ajax (jquery) and it displayed it like this (see image link below)

[img]http://i44.tinypic.com/11ajyuv.png[/img]

Now im outputing it without ajax and it doesnt return it correctly, im wanting to find out what jquery does to convert this and do it within PHP

[img]http://i43.tinypic.com/snyl1x.png[/img]

The main problem is i dont know what this text is encoded with ive tried many functions and googling around but simply cant find an answer, im guessing i will need a set of decode functions then htmlentities it but i dont know the order

few functions ive tried, these are not in any order btw

[code=php]
//$string = utf8_decode($string);
//$string = html_entity_decode($string);
//$string = utf8_encode($string);
//$string = mb_convert_encoding($string, ‘UTF-8’, ‘HTML-ENTITIES’);
//$string = mb_convert_encoding($string, “UTF-8”, “auto”);
//$string = utf8_decode($string);
//$string = html_entity_decode($string);[/code]

Thanks in advance

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiApr 23.2010 — Chances are its encoded as utf-8. Make sure you have the relevant Content-Type header set:

[code=html]<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
[/code]
Copy linkTweet thisAlerts:
@gavshouseauthorApr 24.2010 — i already have that, the data is going into my MySQL then displayed on another page if that helps
Copy linkTweet thisAlerts:
@NogDogApr 24.2010 — Of possible help: [url=http://www.charles-reace.com/blog/2008/10/03/utf8-in-php-and-mysql/]UTF8 in PHP and MySQL[/url].
×

Success!

Help @gavshouse spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...