Click or drag to resize

SatFixBom Method

Add UTF-8 byte order mark (BOM) to a file if not already present.

Namespace: FirmaSAT
Assembly: diFirmaSatNet (in diFirmaSatNet.dll) Version: 10.70.0.38178 (10.70.0.0)
Syntax
public static int FixBom(
	string outputFile,
	string inputFile
)

Parameters

outputFile  String
Name of output file to be created with BOM.
inputFile  String
Name of input file.

Return Value

Int32
Zero (0) on success or a negative error code.
Remarks
It is an error if the input file contains invalid UTF-8 characters.
Example
C#
int n = Sat.FixBom("cfdv40_new-signed-with-BOM.xml", "cfdv40-signed-nobom.xml");
Console.WriteLine("Sat.FixBom returns {0}", n);
// Read in new file as bytes, truncate, and display first 3 bytes: expecting EF-BB-BF
byte[] b = File.ReadAllBytes("cfdv40_new-signed-with-BOM.xml");
Array.Resize(ref b, 3);
Console.WriteLine(BitConverter.ToString(b));
// EF-BB-BF
See Also