Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 985 Bytes

File metadata and controls

31 lines (23 loc) · 985 Bytes

Chatbot project

This folder contains the starting code for the chatbot project.

Troubleshooting

Bot crashes with the unicode error

If your bot code crashes with the error that ends with UnicodeEncodeError: 'ascii' codec can't encode character, your terminal likely has problems showing unicode symbols. To fix this you can change your terminal local by adding the following lines to you ~/.bashrc file (or any other shell configuration):

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

To verify the effect, you can run the following command end check that it outputs 'utf-8'

> python -c 'import locale; print(locale.getpreferredencoding())'
utf-8

You can find more details in this article.

If this doesn't work, you can explicitly specify the encoding when opening files:

with open(filename, 'r', encoding="utf-8") as file:
  ...