You can fix the problem with Malayalam input using the Gboard application released by Google. Access the application's page at Android Informer to install the software on your phone and then go into Settings and tap on Languages. Scroll down to see Malayalam and select it. For other Malayalam text, your phone needs to be equipped with this language.