Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to output a UTF16 encoded file as ascii (or UTF8) on the powershell command prompt?

Given:

PS C:\work> cat .\aclfile
e 7 2 2 d 2 7 6 5 c c c 6 9 3 0 8 5 8 e 5 e 8 7 1 c 1 2 d 7 3 c _ 1 1 4 e 5 6 e b - b 5 1 8 - 4 6 1 2 - 9 d b a - 7 c 6 6 2 5 f 6 c 5 3 1

 D : A I ( A ; ; F A ; ; ; S Y ) ( A ; ; F A ; ; ; B A ) ( A ; ; F R ; ; ; S - 1 - 5 - 5 - 0 - 9 7 3 4 9 ) ( A ; ; F R ; ; ; S - 1 - 5 - 2 1 - 2 0 2 0 4 5 9 8 2 - 2 2 3 5 5 2 7 6 6 3 - 5 2 2 7 6 5 8 3 8 - 1 0 0 0 )

Wanted:

PS C:\work> something .\aclfile
e722d2765ccc6930858e5e871c12d73c_114e56eb-b518-4612-9dba-7c6625f6c531

D:AI(A;;FA;;;SY)(A;;FA;;;BA)(A;;FR;;;S-1-5-5-0-97349)(A;;FR;;;S-1-5-21-202045982-2235527663-522765838-1000)

How can I do it?

Thanks.

like image 859
mark Avatar asked Mar 28 '12 19:03

mark


People also ask

Can PowerShell display Unicode?

PowerShell uses a Unicode character set by default. However, several cmdlets have an Encoding parameter that can specify encoding for a different character set.

What is PowerShell default encoding?

In Windows PowerShell, the default encoding is usually Windows-1252, an extension of latin-1, also known as ISO 8859-1.


1 Answers

try:

PS C:\work> cat .\aclfile -encoding UTF8 # or String, Unicode, Byte,
 BigEndianUnicode,  UTF7, Ascii
like image 167
CB. Avatar answered Sep 29 '22 12:09

CB.