SillyTavern / SillyTavern-Extras

Extensions API for SillyTavern.
GNU Affero General Public License v3.0
549 stars 124 forks source link

Update script.py -- fixing UnicodeEncodeError: 'charmap' codec can't … #227

Closed pevepeve closed 7 months ago

pevepeve commented 7 months ago

Sometimes in non-English locales the websearch script throws an UnicodeEncodeError exception because print("Found: " + text, links) can't render characters in a system encoding.

For example: UnicodeEncodeError: 'charmap' codec can't encode character '\u2212' in position 1433: character maps to

This small fix sets encoding of print output to UTF-8, sort of resolving the issue.