sebonlien / bitly-api

Automatically exported from code.google.com/p/bitly-api
0 stars 0 forks source link

XML malformed when result contains chinese characters #60

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It appears the XML format returns whitespace when Chinese characters are 
present. E.g.
http://api.bit.ly/v3/expand?format=xml&shortUrl=http%3A%2F%2Fbit.ly%2FIkzebS
(Login details intentionally removed)

Below are PHP var_dump()s of using the above URL with XML, JSON and txt:

PHP var_dump of XML:
string(1) " "

PHP var_dump of JSON:
string(473) "{ "status_code": 200, "status_txt": "OK", "data": { "expand": [ { 
"short_url": "http:\/\/bit.ly\/IkzebS", "long_url": 
"http:\/\/ax.itunes.apple.com\/WebObjects\/MZSearch.woa\/wa\/search?term=\ufffe\
u4c00\u6900\u7400\u6f00\u2000\u4d00\u4300\u2000\u4300\u6100\u7300\u7300\u6900\u6
400\u7900 \ufffe\u5200\u6500\u7300\u7000\u6500\u7400\u6f00 
\ufffe\u4c00\u6100\u2000\u5200\u6500\u7000\u7500\u6200\u6c00\u6900\u6300\u6100",
 "user_hash": "IkzebS", "global_hash": "IkzebT" } ] } } "

PHP var_dump of TXT:
string(180) 
"http://ax.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?term=￾䰀椀琀�
�� 䴀䌀 䌀愀猀猀椀搀礀 ￾刀攀猀瀀攀琀漀 
￾䰀愀 刀攀瀀甀戀氀椀挀愀 "

Original issue reported on code.google.com by detritus.c on 25 Apr 2012 at 2:46