Open watho opened 6 years ago
Reactivating my python-knowledge i found two solutions. Seems to be a general python2-problem. Python guesses the codepage of stdout. So it uses utf8 in bash but ascii or None in conky or for example using pipes. See https://stackoverflow.com/questions/492483/setting-the-correct-encoding-when-piping-stdout-in-python
I leave this issue open, cause it should be either fixed with a) or documented as in b)
Thanks for the report and follow-up. This is related to #335.
I think the issue with solution (a) is that if someone has their locale set to expect a different encoding then we could generated incorrect text (or just tofu) when outputting explicit utf-8. I haven't explicitly tested this, so let me know if I'm off-base here.
You're probably right that this should, at a minimum, be documented. I'd be happy to accept a pull request with that note.
Hi guys,
I've tried the fix with --conky and --lineart option, but unfortunately i'm still getting the issue ; did you made some progress on this ? :+1:
`florian@florian-MS-7758:~$ /usr/local/bin/gcalcli agenda --conky --lineart=unicode | tee output.txt
Traceback (most recent call last):
File "/usr/local/bin/gcalcli", line 12, in
mer. mars 13 8:40 go Boulot load_entry_point('gcalcli==4.0.4', 'console_scripts', 'gcalcli')() File "build/bdist.linux-x86_64/egg/gcalcli/cli.py", line 155, in main File "build/bdist.linux-x86_64/egg/gcalcli/gcal.py", line 1200, in AgendaQuery File "build/bdist.linux-x86_64/egg/gcalcli/gcal.py", line 1184, in _display_queried_events File "build/bdist.linux-x86_64/egg/gcalcli/gcal.py", line 1053, in _iterate_events File "build/bdist.linux-x86_64/egg/gcalcli/gcal.py", line 717, in _PrintEvent File "build/bdist.linux-x86_64/egg/gcalcli/printer.py", line 91, in msg UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 26: ordinal not in range(128) `
Thanks guys
There are several similar UnicodeDecodeError issues reported, duped to this and generalized to remove the conky label.
(Actually since this one's not on Windows I'll keep this one separate for conky and just dupe the Windows ones into #387.)
Can anyone still repro, and if so can you share your locale-related settings like $LANG
?
I can't seem to repro any such error with "ü" or "あ🎈" or any such special characters in my event names (although some of those chars didn't display correctly inside conky).
I tried the masterbranch to use the new option lineart=unicode (see #97) inside conky. There is a regression when calling gcalcli inside conky script independent of any lineart settings. e.g.
{execpi 120 gcalcli --conky agenda}\
The following error happens for me
The failing character is the german umlaut ü.
No error when running it in normal bash terminal. No error with v3.4.0 inside conky besides #97 .