jrupac / tasky

A command-line desktop client for Google Tasks.
GNU General Public License v3.0
114 stars 33 forks source link

Should be able to handle unicode chars #26

Closed almenjonatan closed 7 years ago

almenjonatan commented 9 years ago

Cannot handle é. I tasky crashes trying to do anything with the tasklist containing that char. the tasklist was created when I did not put anything and it defaulted to my name

Traceback (most recent call last):
  File "./tasky.py", line 529, in <module>
    main(sys.argv)
  File "./tasky.py", line 512, in main
    tasky.HandleInputArgs()
  File "./tasky.py", line 406, in HandleInputArgs
    '" and all its contents permanently. Are you sure? (y/n): ')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 38: ordinal not in range(128)
dukeglukem commented 9 years ago

I have the same problem - all the Russian characters in google tasks return the same error when using tasky. To fix this problem I added manually .encode('utf-8') for each print(...) function in tasky.pl.

sbenben commented 7 years ago

Me too with the same problem - german umlauts in a tasklist title make tasky crash in print ('%s %s (%s)' % ( self.taskLists.keys().index(taskListId), self.idToTitle[taskListId], len(self.taskLists[taskListId])))

Fix would be very much appreciated:)

jrupac commented 7 years ago

Could you try now? It seems to work for me:

$ python tasky.py
0 Personal
  0 [ ] 
1 Grocery List
  0 [ ] test
    1 [ ] Pay my phone bill
[-a]dd, [-c]lear, [-d]elete, [-e]dit, [-r]emove task, [-m]ove, [-n]ew list/re[-n]ame, [-s]ummary, [-t]oggle, [-q]uit: -a --title "café" --tasklist 1 -p 1
Adding task...
0 Personal
  0 [ ] 
1 Grocery List
  0 [ ] test
    1 [ ] Pay my phone bill
      2 [ ] café
[-a]dd, [-c]lear, [-d]elete, [-e]dit, [-r]emove task, [-m]ove, [-n]ew list/re[-n]ame, [-s]ummary, [-t]oggle, [-q]uit: -n --title "Néw list"
Creating new task list...
0 Personal
  0 [ ] 
1 Grocery List
  0 [ ] test
    1 [ ] Pay my phone bill
      2 [ ] café
2 Néw list (empty)