Sometimes I m getting unicode errors like below in my django site when user submit form data.
“‘ascii’ codec can’t encode character u’\u2014′ in position 109: ordinal not in range(128)”
How can i reproduce the unicode error in my system
Many Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Submit the form causing the errors with unicode characters (e.g.
é) in it!This is a very common error in Django projects and it almost always means you are calling str() somewhere. Django uses unicode strings internally but when you call str() you are asking Python to give you an ascii string back, which fails with this message.
If you give us more info, we’ll be able to help you further.
Good luck!