encode unicode characters as entities