Author Posts

June 23, 2015 at 1:36 pm

Hi.
I write in the script:

$a = read-host "Entre com sua opção:
1)Consultar relatório de servidor
2)Consultar relatório de pensionista
3)Consultar relatório de consignatário"

but the accents don't appear correctly:
Entre com sua opção:
1)Consultar relatório de servidor
2)Consultar relatório de pensionista
3)Consultar relatório de consignatário:

what i do?

June 23, 2015 at 1:43 pm

The PowerShell console app is not Unicode/DBCS compatible. For characters requiring a double-byte character set, there is no workaround other than to not use those characters. The console app isn't actually PowerShell; it's the Windows console host and it's pretty ancient.

July 22, 2015 at 6:56 am

Hi Estudante,

I'm using Win7 with its PowerShell version 2, it works for me. But I suppose it depends on your Windows' locale encoding. For you, I think "Western European" might work. But try to save your script in UTF-16 BE with BOM. Normally, if you use "Windows PowerShell ISE", it would take care of it.

However, if your Windows' locale is not Western European, I'm afraid that would not work and me too, I'm waiting Microsoft to fix this bug.

Telling people "... to not use those characters" is so dumb! Sorry to say so. Come on, we are in the 2nd decade of the 21st century and Unicode is still not supported? It's like we're using computer in the 80's. That's so archaic!

Not only is it dumb to tell people to not use those characters, it's also a lack of respect to others' culture and language.

Come on Microsoft. Wake up!

July 22, 2015 at 6:59 am

The console app actually dates from the 1980s, and the PowerShell team doesn't "own" it, so they can't fix it. The fix was the PowerShell ISE, which does support Unicode just fine. Unfortunately, the actual console host has a ton of dependencies on it, so it's not easily fixed without a major effort, which thus far Microsoft hasn't made.

It's nothing to do with a lack of respect on anyone's part. The PowerShell team is well aware of the problem, which is a large part of why the ISE was created.

July 22, 2015 at 7:11 pm

as far as I understand they made some improvement to the W32Console in Windows 10. don't know if they solved this one.

August 12, 2015 at 11:25 am

thanks, my friends.