duino-coin icon indicating copy to clipboard operation
duino-coin copied to clipboard

PC Miner UnicodeEncodeError: * codec can't encode character - on Raspberry Pi

Open Flight1530 opened this issue 5 years ago • 7 comments

I just did a fresh clone for the Raspberry PI, when I tried to start the program with "python3 PC_Miner.py", this is the error message I received, what did I do wrong?

~/duino-coin $ python3 PC_Miner.py Xxhash is not installed - this mining algorithm will be disabled Traceback (most recent call last): File "PC_Miner.py", line 865, in Miner.greeting() File "PC_Miner.py", line 424, in greeting + Fore.RESET + "2019-2021") File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 40, in write self.__convertor.write(text) File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 143, in write self.wrapped.write(text) UnicodeEncodeError: 'latin-1' codec can't encode character '\u2016' in position 11: ordinal not in range(256)

Flight1530 avatar Oct 24 '21 02:10 Flight1530

Hello @Flight1530 , usually this error is caused by 2 reasons:

  1. Corrupt translation file: try to close the miner, romove the file Translations.json inside the folder Duino-Coin PC Miner 2.73 and run the miner again

  2. Wrong seted system locales: It may be that your linux default language does not allow all UTF8 characters so you will need to set this locale to UTF8... Each linux distro has its peculiarities for this procedure, for this reason I won't leave any tutorial here... this was the solution for this user https://github.com/revoxhere/duino-coin/issues/983

If it works:heavy_check_mark:, let us know, otherwise tell us more details so we can help you

gsrbr avatar Oct 24 '21 03:10 gsrbr

This fix works. Just need to restart the puTTy session (on windows) after applying the fix. Thank you.

XENE1 avatar Oct 26 '21 12:10 XENE1

Closed due to inactivity, feel free to reopen if problem perists

BastelPichi avatar Nov 03 '21 16:11 BastelPichi

Hello! I launched PC Miner 3.18 on Raspberry Pi 4 (installed everything according to the instructions from the official duino coin website, via the console). As a result, this is what I got:

Traceback (most recent call last): File "/home/pi/duino-coin/PC_Miner.py", line 1248, in Donate.start(int(user_settings["donate"])) File "/home/pi/duino-coin/PC_Miner.py", line 464, in start pretty_print(get_string('thanks_donation').replace("\n", "\n\t\t"), File "/home/pi/duino-coin/PC_Miner.py", line 555, in pretty_print print(Fore.WHITE + datetime.now().strftime(Style.DIM + "%H:%M:%S ") File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 41, in write self.__convertor.write(text) File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 164, in write self.wrapped.write(text) File "/usr/lib/python3.9/encodings/cp1251.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 73-74: character maps to

Please tell me what's wrong?

l23as avatar Apr 21 '22 09:04 l23as

Hi, please don't revive old issues.

Try running this command before the miner:

chcp 65001

LDarki avatar Apr 21 '22 13:04 LDarki

It doesn't work, unfortunately!

l23as avatar Apr 21 '22 14:04 l23as

Try with this then.

// If you're on linux

set PYTHONIOENCODING=utf-8

// if you're on windows

set PYTHONLEGACYWINDOWSSTDIO=utf-8

LDarki avatar Apr 21 '22 14:04 LDarki