Add UTF-8 byte order mark (BOM) to a file if not already present.
Namespace: FirmaSATAssembly: diFirmaSatNet (in diFirmaSatNet.dll) Version: 10.70.0.38178 (10.70.0.0)
Syntaxpublic static int FixBom(
string outputFile,
string inputFile
)
Public Shared Function FixBom (
outputFile As String,
inputFile As String
) As Integer
Parameters
- outputFile String
- Name of output file to be created with BOM.
- inputFile String
- Name of input file.
Return Value
Int32Zero (0) on success or a negative
error code.
RemarksIt is an error if the input file contains invalid UTF-8 characters.
Exampleint n = Sat.FixBom("cfdv40_new-signed-with-BOM.xml", "cfdv40-signed-nobom.xml");
Console.WriteLine("Sat.FixBom returns {0}", n);
byte[] b = File.ReadAllBytes("cfdv40_new-signed-with-BOM.xml");
Array.Resize(ref b, 3);
Console.WriteLine(BitConverter.ToString(b));
See Also