为什么这个PHP脚本不会从文件中剥离BOM?

I've tried everything I can think of (including notepad++, which would not work for me although it appears others have better luck).

I've some very old Access databases (I mean from the mid/late 1990s created using Visual Basic 4) which I'm converting to Web Apps (PHP, Javascript etc using a lot of AJAX).

I've an old copy of Access2000 which despite a myriad of errors does actually still work under Windows 10 with some persuasion; which I'm using to export data with.

What I have a slight problem with is encoding. I'm trying to export as UTF8 to try and avoid diamonds with ? marks in them. Access has a UFT8 export setting but it puts a BOM (FFFE) at the start of the file(s); which messes things up a bit.

Simple question: why does not the following work? Well, actually, it works but it strips the first 2 bytes after the BOM and leavs the BOM in place.

It's nothing I can't work round so no sweat; just wondering.

<?php
$h = fopen("test.txt", "rb");
$w = fopen("fixed.txt", "wb");

$r = fread($h, "2");
do{
  $r = fread($h, "1");
  fwrite($w, $r); 
} while (!feof($h));

fclose($h);
?>