PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

Error encoding Russian pokestop names

Open ChronoAS opened this issue 10 years ago • 5 comments

Arrived at Pokestop
Traceback (most recent call last):
  File "Q:\Poke\PokemonGo-Bot-master\pokecli.py", line 103, in <module>
    main()
  File "Q:\Poke\PokemonGo-Bot-master\pokecli.py", line 100, in main
    bot.take_step()
  File "Q:\Poke\PokemonGo-Bot-master\pokemongo_bot\__init__.py", line 29, in take_step
    self.stepper.take_step()
  File "Q:\Poke\PokemonGo-Bot-master\pokemongo_bot\stepper.py", line 70, in take_step
    self.bot.work_on_cell(cell,position)
  File "Q:\Poke\PokemonGo-Bot-master\pokemongo_bot\__init__.py", line 50, in work_on_cell
    hack_chain = worker.work()
  File "Q:\Poke\PokemonGo-Bot-master\pokemongo_bot\cell_workers\seen_fort_worker.py", line 45, in work
    print_yellow('Now at Pokestop: ' + fort_name + ' - Spinning...')
  File "Q:\Poke\PokemonGo-Bot-master\pokemongo_bot\cell_workers\utils.py", line 17, in print_yellow
    print('\033[93m' + message + '\033[0m');
  File "C:\Python27\lib\codecs.py", line 369, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 22: ordinal not in range(128)

ChronoAS avatar Jul 22 '16 15:07 ChronoAS

Related to #213 . We're right now aware of this, and it's on the list of things to fix.

jtdroste avatar Jul 22 '16 15:07 jtdroste

@jtdroste we should add the utf-8 setup line to the beginning of every Python source code. It should fix everything automatically, I think.

douglascamata avatar Jul 22 '16 15:07 douglascamata

@ChronoAS try again - I just pushed a change that should fix this.

EDIT: Tested it, didn't fix it :(. Still lookgin...

jtdroste avatar Jul 22 '16 15:07 jtdroste

@jtdroste nothing changed even with the new headers

ChronoAS avatar Jul 22 '16 15:07 ChronoAS

This should be good thanks to another PR. I'm waiting to merge #213 to solve when a location contains unicode characters, but your issue should be resolved.

jtdroste avatar Jul 22 '16 16:07 jtdroste