Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Wrong UTF8 encoding setting #1

Closed
zewelor opened this issue Jan 12, 2019 · 2 comments
Closed

Wrong UTF8 encoding setting #1

zewelor opened this issue Jan 12, 2019 · 2 comments

Comments

@zewelor
Copy link

zewelor commented Jan 12, 2019

Hi

I'm getting encoding error:

2019-01-12T19:26:30.480952308Z  ON_CONVERSATION_TURN_STARTED -                                                                                                                                                                
2019-01-12T19:26:30.482750476Z  Traceback (most recent call last):
2019-01-12T19:26:30.482861749Z    File "/gawebserver.py", line 182, in <module>                                                                                                                                                   
2019-01-12T19:26:30.483008450Z      main()
2019-01-12T19:26:30.483045945Z    File "/gawebserver.py", line 179, in main                                                                                                                                                       
2019-01-12T19:26:30.483104911Z      process_event(event)
2019-01-12T19:26:30.483134133Z    File "/gawebserver.py", line 70, in process_event
2019-01-12T19:26:30.483193397Z      print(event)
2019-01-12T19:26:30.483222601Z  UnicodeEncodeError: 'ascii' codec can't encode character '\u2026' in position 92: ordinal not in range(128)

From what I've found, it because of wrong locale env setting, and it can be fixed using PYTHONIOENCODING=utf-8. I've put it in docker run command and seems to work fine.

@robwolff3
Copy link
Owner

Hey, sorry I didn't see this issue sooner.

That's interesting, I have not seem that error before. Ill add it to an issues section. Thanks for contributing this fix!

@almostserious
Copy link

This fix doesnt work for me. I still get the error:

gawebserver    |     self._lib.assistant_send_text_query(self._inst, query.encode('ASCII'))
gawebserver    | UnicodeEncodeError: 'ascii' codec can't encode character '\xdc' in position 10: ordinal not in range(128)

I even tried adding the German Local to my Docker-Compose

environment:
      - PYTHONIOENCODING=utf-8
      - LANG=de_DE.UTF-8

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants