DetectEncoding

LoadOptions.DetectEncoding property

This option enables TXT, TSV, and CSV files encoding detection. In case the encoding can’t be detected the default Encoding is used.

public bool DetectEncoding { get; set; }

Remarks

Learn more about rendering text and tab/comma delimited files

Examples

The example demonstrates a typical usage of this option.

LoadOptions loadOptions = new LoadOptions();
loadOptions.DetectEncoding = true; // Enable encoding detection

using (Viewer viewer = new Viewer("employees.csv", loadOptions))
{
    HtmlViewOptions viewOptions = 
        HtmlViewOptions.ForEmbeddedResources();

    viewer.View(viewOptions);
}

See Also