Cool, thanks for the super-quick turnaround, I see the updated script live now.
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?
Here's what I get now:
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/).
wget -O - "http://www.doomworld.com/idgames/api/api.php?action=get&id=17259&out=json" | xxd | less
00000a0: 7574 686f 7222 3a22 5a6f 6c74 c3a1 6e20 uthor":"Zolt..n
00000b0: 53c3 b366 616c 7669 2028 5a38 3629 222c S..falvi (Z86)",
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:
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.
$ 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... 22.214.171.124
Connecting to www.doomworld.com|126.96.36.199|: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
Keep-Alive: timeout=15, max=500
Length: unspecified [application/json]
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.?
Last edited by spicyjack on Sep 21 2013 at 19:56