Improved sendChar() function allowing it to handle special characters