Handle Unicode errors gracefully