UtilityReadWithEncoding Method
This is used to read in a file using an appropriate encoding method
Namespace: SandcastleBuilder.UtilsAssembly: SandcastleBuilder.Utils (in SandcastleBuilder.Utils.dll) Version: 2024.12.21.0
public static string ReadWithEncoding(
string filename,
ref Encoding encoding
)
Public Shared Function ReadWithEncoding (
filename As String,
ByRef encoding As Encoding
) As String
public:
static String^ ReadWithEncoding(
String^ filename,
Encoding^% encoding
)
static member ReadWithEncoding :
filename : string *
encoding : Encoding byref -> string
- filename String
- The file to load
- encoding Encoding
- Pass the default encoding to use. On return, it contains the actual encoding
for the file.
StringThe contents of the file
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.