Exercise 23, PowerShell problem displayed


#1

Hi,

I’m doing Exercise 23 on python 3 and I see squares for some line after " <===> " instead of the word in different language.

Exemple: (I have put “+” because I can’t reproduce the square … So first line is fine but second have those square)
PS I:\Backup\Dropbox\Cours\Python\HardWayExercices> python ex23.py utf-8 strict
b’Afrikaans’ <===> Afrikaans
b’\xe1\x8a\xa0\xe1\x88\x9b\xe1\x88\xad\xe1\x8a\x9b’ <===> ++++

*I have upload the result too

I use PowerShell in windows 10 … I have search on the web and try couple of thing to turn PowerShell into utf-8 but It doesn’t work.

You have any idea why?


#2

That’s normal. To make it work in PowerShell requires a lot of weird installs of different fonts. However, apparently it’ll work in cmd.exe. In the video you see me trying to get it to work and I still can’t. Try with cmd.exe and let me know what you find.


#3

Hi zedshaw,

Thanks for your fast answer. Unfortunately I have the same result in cmd.exe …

I guess I can continue without it …


#4

Maybe someone could try PowerShell ISE? I have read it has more fonts.

I’ve tried running this exercise there, but it didn’t run like it did in PowerShell.
I have no idea why, because I don’t know a lot about software/programming yet.


#5

I try PowerShell ISE and the script don’t execute. It gives errors …


#6

Finally, I just download a third party windows terminal emulator name Cmder and it work now, I see all the character of all language, no more stupid square!

I’m like that, I can’t continue when there is something not working. Now I’ll get back to understand this code!

:+1:


#7

Interesting…do you have a link for Cmder? I can’t find it on google. I’d like to try it.


#8

Quick search pointed to http://cmder.net

Looks interesting, it appear that this is built on (or continues on) the terminal / console emulator ConEmu. We had used ConEmu in the past with Win7 and it worked fairly well.


#9

Exactly where I found it, jdknaebel.


#10

Yes, cmder works. Strange isn’t it, and I worked with Powershell and Powershell ISE for hours trying to dope it out. Frustrating.


#11

Hi - I’m on exercise 23 now and get this error below. Is it related to the same problem with Powershell?

UnicodeDecodeError: ‘utf-8’ codec can’t decode bytes in position 11-12: invalid continuation byte

Thanks,