Added smartString(), a function that converts any incoming string into Unicode safely.