Python Forum

Full Version: chatterbot utf-8 errors with mysql database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone. In the process to create a chatbot using chatterbot.
The issue is when trying to load a sql database for the training process.
This is the error that occurs:

Error:
File "C:\Users\ryan\AppData\Local\Programs\Python\Python38-32\lib\codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xec in position 27: invalid continuation byte
This is the source code for the training script:

from chatterbot.trainers import ListTrainer
from talkbot import bot
from chatterbot import ChatBot
from settings import REDDIT
import logging
from chatterbot.trainers import ChatterBotCorpusTrainer


trainer = ChatterBotCorpusTrainer(bot)

trainer.train("C:/Users/ryan/Documents/Code/2015-01.db")