Redirection produces a UCS-2 file

Started by davidr, May 21, 2019, 10:25:40 AM

Previous topic - Next topic

davidr

Redirecting the output of exiftool produces a UCS-2 LE BOM format file.
e.g.
exiftool -title file.jpg > file.txt

At least on my Windows 10, using Powershell console it does.

I want the file to be UTF8, but using
exiftool -title -charset UTF8 file.jpg > file.txt
still writes UCS-2

Any suggestions?
(first time poster so polite ones please  :) )



davidr

To answer my own question.
It is Powershell that produces the UCS-2
I tried with a good old fashioned Command Prompt, and it produces UTF8

Should have thought before posting!

Phil Harvey

Yes.  Don't try to redirect in PowerShell, it does some other really bad things to the output as well.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).