Published on

How to solve UnicodeDecodeError on Windows 10

UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 1: ordinal not in range(128)

This error shows to me when I'm trying to build electron from source. These steps show you how to solve it:

  1. Open cmd.exe
  2. git clone https://github.com/electron/electron.git
  3. cd electron && python script\bootscript.py -v

Error occurs

  1. Open powershell.exe
  2. python script\bootscript.py -v

Error occurs

  1. open ubuntu in powershell
  2. cd /mnt/d/electron
  3. python script\bootscript.py -v

OK

I find this post on stackoverflow. Its tl;dr reply shows the details and the reason why you come across with this error on Windows.

And this is settings on my Windows:

cmd-console-gkb powershell-console-gkb ubuntu-console-utf-8