62986
I've been trying to add new features that use JSON to throw information between the browser and the server. I noticed that sometimes the JSON is an empty string coming from php's json_encode(). It had me scratching my head for a while until I really dug into it.
Basically, UTF-8 was not the standard when I started BotB in 2005. Latin1_(whatevs) for collation and ISO-8859-1 for a character set were all the rage. There were a handful of older tracks with special characters and they made for some interesting filenames. I've learned a lot about dealing with this bullshit, I gotta tell ya. Sometimes you need printf inline.
Combing through all 20k+ entries with a script, I managed to find and fix all characters breaking json_encode(). I'm guessing it was less than 50 as my scanner could only handle 1,000 at a time. Kind of annoying at first, but pretty easy once I got the patterns down.
Unfortunately, this audit also produces a list of missing entries --
http://battleofthebits.com/arena/Entry/jahzone.it/3397/
http://battleofthebits.com/arena/Entry/grabbing+rice.xm/3559/
http://battleofthebits.com/arena/Entry/hecho_en_venezuela.nsf/4476/
http://battleofthebits.com/arena/Entry/banzai.nsf/4478/
http://battleofthebits.com/arena/Entry/txt.txt/4611/
http://battleofthebits.com/arena/Entry/coffee+cigarrette.mp3/5542/
http://battleofthebits.com/arena/Entry/OHCHaiku.txt/7503/
http://battleofthebits.com/arena/Entry/doc-11.txt/8630/
http://battleofthebits.com/arena/Entry/0k.xm/12011/
I looked through my various backups, but nope. They are all OHB tracks, but it's still a tiny bit sad. :(
This one I think was overwritten by the author with a tiny mp3 --
http://battleofthebits.com/arena/Entry/love.png/18194/
Now, with this out of the way, I can start writing moar javascrorpt features that utilize JSON instead of the other way.
Basically, UTF-8 was not the standard when I started BotB in 2005. Latin1_(whatevs) for collation and ISO-8859-1 for a character set were all the rage. There were a handful of older tracks with special characters and they made for some interesting filenames. I've learned a lot about dealing with this bullshit, I gotta tell ya. Sometimes you need printf inline.
Combing through all 20k+ entries with a script, I managed to find and fix all characters breaking json_encode(). I'm guessing it was less than 50 as my scanner could only handle 1,000 at a time. Kind of annoying at first, but pretty easy once I got the patterns down.
Unfortunately, this audit also produces a list of missing entries --
http://battleofthebits.com/arena/Entry/jahzone.it/3397/
http://battleofthebits.com/arena/Entry/grabbing+rice.xm/3559/
http://battleofthebits.com/arena/Entry/hecho_en_venezuela.nsf/4476/
http://battleofthebits.com/arena/Entry/banzai.nsf/4478/
http://battleofthebits.com/arena/Entry/txt.txt/4611/
http://battleofthebits.com/arena/Entry/coffee+cigarrette.mp3/5542/
http://battleofthebits.com/arena/Entry/OHCHaiku.txt/7503/
http://battleofthebits.com/arena/Entry/doc-11.txt/8630/
http://battleofthebits.com/arena/Entry/0k.xm/12011/
I looked through my various backups, but nope. They are all OHB tracks, but it's still a tiny bit sad. :(
This one I think was overwritten by the author with a tiny mp3 --
http://battleofthebits.com/arena/Entry/love.png/18194/
Now, with this out of the way, I can start writing moar javascrorpt features that utilize JSON instead of the other way.