OrkoHunter / ping-me

A cross platform personalized Ping
Apache License 2.0
192 stars 21 forks source link

UTF-8 decoding #15

Open rndev-io opened 8 years ago

rndev-io commented 8 years ago

when i add task on russian language

$ ping-me -d November-24-2015 -t 14:30 привет
Traceback (most recent call last):
  File "/usr/local/bin/ping-me", line 9, in <module>
    load_entry_point('ping-me==0.2.1', 'console_scripts', 'ping-me')()
  File "/usr/local/lib/python2.7/dist-packages/ping_me/ping.py", line 46, in main
    ' ' + ' '.join(args.TIME))
  File "/usr/local/lib/python2.7/dist-packages/dateutil/parser.py", line 1003, in parse
    timestr = timestr.decode()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 23: ordinal not in range(128)
harshcrop commented 7 years ago

what is the problem in UTF decoding ?? can you explain me?

OrkoHunter commented 7 years ago

I believe we need to declare UTF 8 encoding in the header for Python 2. http://stackoverflow.com/questions/6289474/working-with-utf-8-encoding-in-python-source

harshcrop commented 7 years ago

from future import unicode_literals can we use this for solution??

OrkoHunter commented 7 years ago

Try -- coding: utf-8 -- On top of the modules

On Thu, 22 Dec 2016, 13:58 Harsh Shah, notifications@github.com wrote:

from future import unicode_literals can we use this for solution??

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/OrkoHunter/ping-me/issues/15#issuecomment-268746049, or mute the thread https://github.com/notifications/unsubscribe-auth/AHsTeTv5ELMpbO_H_1dz7bY5-G90acrjks5rKjSpgaJpZM4GzXLN .

-- Himanshu Mishra Third Year Undergraduate Mathematics and Computing IIT Kharagpur http://orkohunter.net

harshcrop commented 7 years ago

ya, that i can do. can i add this line in ping.py file is that okay?

OrkoHunter commented 7 years ago

Yes that'd be okay. You may add it in all the modules.

On Thu, 22 Dec 2016, 14:03 Harsh Shah, notifications@github.com wrote:

ya, that i can do. can i add this line in ping.py file is that okay?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OrkoHunter/ping-me/issues/15#issuecomment-268746902, or mute the thread https://github.com/notifications/unsubscribe-auth/AHsTeWK7g-T8yUsan4Nl3mIRo4qwhtW_ks5rKjXagaJpZM4GzXLN .

-- Himanshu Mishra Third Year Undergraduate Mathematics and Computing IIT Kharagpur http://orkohunter.net