Error handling for unicode input