hello,
i have a chatbot application with two MySql DBs:
1. db for the django backend.
2. chatbot_brain for the chatbot background knowledge.
Basically, when the user start the conversation:
1. the chatbot.py gets the input using model's value_list()
2. stretch for a matching input in chatbot_brain
3. update with the replay using model.
i have two issues:
- is when i try to find the matching string using LIKE query, it produce this EROR message:
-- UnicodeEncodeError:'latin-1' codec can't encode character--
I have tried many solutions such ass using (charset='utf8') in the connection but it made the website very slow after i restart the server, and cursor.execute("set names 'utf8'")
- when i try to write the conversation in CSV file i got these symbols "ØŸ ØŸ"
Also, i checked that when i created the DB the encode is utf8 but when i opened phpMyAdmin a saw in both DBs :
chatbot_brain=>utf8_general_ci
information_schema=>utf8_general_ci
Total: 2=> latin1_swedish_ci
So, the chatbot can't find the matching string i don't know where the problem is because before i was using sqlite3 and everything was working.
I'm using Django 10, python3 and pymysql to connect to the DB and my language is Arabic.
asked
26 Apr '17, 16:57
eman_saad
11●2●8
accept rate:
0%