Looks like I just found the solution by stumbling onto this function: https://www.php.net/manual/en/uconverter.transcode.php
mb_convert_encoding did not work for me, but this did:
$line = UConverter::transcode($line, 'UTF-8', 'UTF-16BE');