I just double checked and it is actually working!! Instead of being fancy I just printed a hex dump before and a hex dump after and I could then look at the output with a text editor and it was clear.
before:
ef bb bf 49 6d 70 6f 72 74 61 6e 63 65 2c 46 69 72 73 74 20 4e 61 6d 6
+5 2c 4d 69 64 64
after:
49 6d 70 6f 72 74 61 6e 63 65 2c 46 69 72 73 74 20 4e 61 6d 65 2c 4d 6
+9 64 64 6c 65 20
before:
2c 2c 2c 2c 2c 22 ef bb bf 39 35 33 2d 31 35 31 33 a
after:
2c 2c 2c 2c 2c 22 39 35 33 2d 31 35 31 33 a
Sorry for sowing so much confusion due to my incompetence...