-1

I have a UTF-16 LE file and at the beginning it has a BOM.

How do I remove this using C++? I've seen many Python examples.

Ultimately I would like it to be a UTF-8.

JeffR
  • 765
  • 2
  • 8
  • 23

1 Answers1

2

How can I remove the BOM from a UTF-16 LE file in C++?

The size of UTF-16 BOM is 2 bytes. You can remove the BOM by copying all bytes except the first two that contain the BOM into a new file. Replace the old file with the new.

eerorika
  • 232,697
  • 12
  • 197
  • 326