spicyjack
Mini-Member
Posts: 61
Registered: 08-09 |
MTrop said:
Okay. I've sent off the change to bloodshedder.
If you see the date at the top of the API page changed to 9/19/2013, it's been applied.
EDIT: Okay - looks like we're good here. Not sure if PHP is sending back the correct encoding headers, but according to Fiddler2, it's readable as UTF-8. Are you able to double-check?
Cool, thanks for the super-quick turnaround, I see the updated script live now.
Here's what I get now:
code: wget -O - "http://www.doomworld.com/idgames/api/api.php?action=get&id=17259&out=json" | xxd | less
{snip}
00000a0: 7574 686f 7222 3a22 5a6f 6c74 c3a1 6e20 uthor":"Zolt..n
00000b0: 53c3 b366 616c 7669 2028 5a38 3629 222c S..falvi (Z86)",
So the 0xe1 is now 0xc3 0xa1, and 0xf3 is now 0xc3 0xb3, both of which are the valid UTF-8 replacement sequences for the offending ISO-8859-1 characters (according to http://www.utf8-chartable.de/).
This was actually a good lesson for me, it reminded me that I ALWAYS need to validate my input from external sources :) If I find anything else wonky, I'll be sure to let you know.
As far as the headers:
code: $ wget --spider --server-response "http://www.doomworld.com/idgames/api/api.php?action=get&id=17259&out=json"
Spider mode enabled. Check if remote file exists.
--2013-09-21 11:17:25-- http://www.doomworld.com/idgames/ap...=17259&out=json
Resolving www.doomworld.com... 38.68.5.148
Connecting to www.doomworld.com|38.68.5.148|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Date: Sat, 21 Sep 2013 18:17:22 GMT
Server: Apache/2.2.23 (Unix) PHP/5.4.10
X-Powered-By: PHP/5.4.10
Keep-Alive: timeout=15, max=500
Connection: Keep-Alive
Content-Type: application/json
Length: unspecified [application/json]
No, no encoding type mentioned in the headers. For what it's worth, the XML output also doesn't have encoding type in the headers, but since character encoding is part of the document, it's not such a big deal.
I'll keep in mind the contact e-mail address mentioned above in the about call, however, any chance of posting the API script somewhere publicly, preferably some place with a issues/bug queue, like GitHub/Bitbucket/Sourceforge/etc.?
Thanks again!
Last edited by spicyjack on Sep 21 2013 at 19:56
|