PowerShell and CMD 'pipe' outputs vs exiftool -w tag (utf-8 vs utf-16 encoding

Started by oldHacker, December 19, 2022, 10:04:16 PM

Previous topic - Next topic

oldHacker

Just an FYI Note here, hopefully saving others time on Windows mysteries.
Windows PowerShell and CMD 'pipe' outputs vs exiftool -w tag (utf-8 vs utf-16 encoding)
Different output file sizes are created using exiftool in these three different forms;
1) PowerShell; exiftool -w tag
2) PowerShell; '>' pipe utility
3) CMD window; '>' pipe utility

Following are details of the exiftool command line and resultant output file.

PowerShell; exiftool -w tag
PS D:\exiftool> D:\exiftool\exiftool.exe -p D:\exiftool\gpx.fmt -ee3 D:\exiftool\20220712_143905.MP4 -w out.gpx
creates this file
20220712_143905out.gpx   25KB,   size on disk  28.0 KB (28,672 bytes)   encoding = utf-8

PowerShell pipe
PS D:\exiftool>  D:\exiftool\exiftool.exe -p D:\exiftool\gpx.fmt -ee3 D:\exiftool\20220712_143905.MP4 > D:\exiftool\20220712_143905.MP4.gpx
creates this file
20220712_143905.MP4.gpx   49KB,  size on disk  52.0 KB (53,248 bytes)   encoding = utf-16 LE BOM

CMD pipe
D:\exiftool\exiftool.exe -p D:\exiftool\gpx.fmt -ee3 D:\exiftool\20220712_143905.MP4 > D:\exiftool\20220712_143905.MP4.gpx
creates this file
20220712_143905.MP4_cmd.gpx  25KB,   size on disk  28.0 KB (28,672 bytes)   encoding = utf-16 LE BOM

All three output files are identical per notepad++ compare utility.
Output files are attached for those interested in diving deeper into this rabbit hole.
What's the moral of this story?  Use Phil Harvey's tag utilities, forgo Window's pipe utilities.


attached;
20220712_143905out.gpx
20220712_143905.MP4.gpx
20220712_143905.MP4_cmd.gpx

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).