2
This probably isn't an answer, but in the perl/html world, I've had strange display problems when certain files were uploaded in binary mode rather than ascii.
When you look at the table for the chat, is the message stored in the same way? Can you view the source to see if it's doing something strange like adding line break tags after each character?
Brad