You can use this code to limit the number of characters in the title - this code is compatible with UTF-8 characters