Added function for getting message charset.