in reply to utf-8 bytes dropped when printing to a file

This is a "it might change something" suggestion only. Change your binmode statement to

binmode($gOutputFileObj, ":raw:utf8");

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail