function for creating Latin-1 and multibyte strings