Closed peteroupc closed 5 years ago
That is annoying - and I have never actually seen it emit the preamble in practice. The entire idea of emitting a BOM for a UTF8 encoding annoys me to no end. Its not like it is a useful marker.
Closing this issue as moot. As explained in the same documentation, Encoding.UTF8
's methods do not add a byte-order mark automatically; it merely provides a byte-order mark with the GetPreamble
method.
This is to remind you that
Encoding.UTF8
encodes text strings by beginning them with byte-order marks. Thus, code like the following may not work as expected:My library contains a
DataUtilities.GetUtf8Bytes
method that can be used instead: