Table of Contents

ComponentUtilities.ReadWithEncoding Method

Definition

Namespace
Sandcastle.Core
Assembly
Sandcastle.Core.dll

This is used to read in a file using an appropriate encoding method

public static string ReadWithEncoding(string filename, ref Encoding encoding)

Parameters

filename string

The file to load

encoding Encoding

Pass the default encoding to use. On return, it contains the actual encoding for the file.

Returns

string

The contents of the file

Remarks

When reading the file, it uses the default encoding specified but detects the encoding if byte order marks are present. In addition, if the template is an XML file and it contains an encoding identifier in the XML tag, the file is read using that encoding.