ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: davidr on May 21, 2019, 10:25:40 AM

Title: Redirection produces a UCS-2 file
Post by: davidr on May 21, 2019, 10:25:40 AM
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  :) )


Title: Re: Redirection produces a UCS-2 file
Post by: davidr on May 21, 2019, 10:44:34 AM
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!
Title: Re: Redirection produces a UCS-2 file
Post by: Phil Harvey on May 21, 2019, 12:36:52 PM
Yes.  Don't try to redirect in PowerShell, it does some other really bad things to the output as well.

- Phil
Title: Re: Redirection produces a UCS-2 file
Post by: StarGeek on May 21, 2019, 12:52:00 PM
Previous post (https://exiftool.org/forum/index.php/topic,8137.msg41663.html#msg41663) with some links detailing the issue.