|
Hi, In django I am using django-tinymce to create newsletter for my registered users. Content (which is HTMLField()) is in unicode and it is stored in my database (mysql) as unicode correctly. I have this script to send the newsletter to all registered users (except those who have opted-out).
The problem is that unicode characters in the email message is shown as questionmarks (ie. ???????) What am I doing wrong? PS: I also tried this |
|
It looks to me like you're not telling MySQLdb to use unicode. Try setting up your database connection like this:
If that doesn't work (or perhaps as an altogether better approach) you might try accessing your data via the Django model, since Django should handle the unicode stuff for you automatically. For example:
Hope that helps! |
Can you confirm that the content stored in your database is in the correct format and displays correctly? You can try printing it out to a file or to a webpage instead of sending it as an email.
On my browser when viewing/editing my database using phpMyAdmin content appears correct. When I do a
print contentinstead ofsendmailon the above script I do get questionmarks on my terminal screen. Does that make any sense?will you post a sample of what you have in your database? It sounds like what you are putting into the email is not coming out correctly because it is not in the database correctly.