Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emojis do not get written to md #8

Closed
Shadow-AI opened this issue Apr 7, 2024 · 2 comments
Closed

emojis do not get written to md #8

Shadow-AI opened this issue Apr 7, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Shadow-AI
Copy link
Collaborator

Traceback (most recent call last):
File "\spring-ai\chat.py", line 665, in
chatbot.chat(prompt, persistence_enabled=persistence_enabled)
File "spring-ai\chat.py", line 623, in chat
save_response_to_markdown_file(self.messages[-1].content)
File \spring-ai\helpers.py", line 17, in save_response_to_markdown_file
file.write(response_string)
File "\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode characters in position 1-2: character maps to

@Shadow-AI Shadow-AI added the bug Something isn't working label Apr 7, 2024
@Shadow-AI Shadow-AI self-assigned this Apr 7, 2024
@TanGentleman
Copy link
Owner

simplest approach is likely changing a couple lines in helpers.py:
with open(filename, "w", encoding="utf-8") as file: in the couple functions where its applicable for markdown files. It should fix the unicode errors!

@Shadow-AI
Copy link
Collaborator Author

Shadow-AI commented Apr 7, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants