... sorry for the delay, I knew I had found something but I couldn't remember where. Finally, I accidentally stumbled on this while I was trying software for my GA project:
not so new (the website dates the last version, 0.2.1, on 21/aug/2001), but between its nice cryptanalystic features it has some n-grams statistics which calculate entropy too. Source code is available and even if all its functions are just based on text (a-z,A-Z, which is not enough for you I think) you'll be able to modify them to work as you wish... as I'm doing for GAs now
. Code seems quite readable, or maybe it's just me liking everything more than the PHP I'm workin' on lately
good luck, and mail me if you need more detailed help!