Hi all, I was thinking Unknown option is used for binary files concatenation.
http://technet.microsoft.com/en-us/library/dd315299.aspx
Unknown The encoding type is unknown or invalid. The data can be treated as binary.
But {Get-Content binary.dat -Encoding Unknown}
doesn't return byte array but string array.
PS > $a = Get-Content $PSHOME\WTRInstaller.ico -Encoding Unknown
PS > $b = Get-Content $PSHOME\WTRInstaller.ico -Encoding Byte
PS > $a[0].GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String System.Object
PS > $b[0].GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Byte System.ValueType
Even if I convert $a to byte array, it doesn't coincide with $b.
PS > [Text.Encoding]::Unicode.GetBytes($a)
PS > compare $c[0..10] $b[0..10]
InputObject SideIndicator
----------- -------------
10 =>
32 <=
When should 'Unknown' be used?