Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

HtmlDocumentImporterOptions.Encoding Property

Gets or sets the encoding used to interpret characters in the document.

Namespace: DevExpress.XtraRichEdit.Import

Assembly: DevExpress.RichEdit.v20.2.Core.dll

NuGet Package: DevExpress.RichEdit.Core

Declaration

[TypeConverter(typeof(EncodingConverter))]
public Encoding Encoding { get; set; }

Property Value

Type Description
Encoding

A Encoding object providing the conversion between certain encoding and Unicode.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to Encoding
WinForms Controls RichTextEditDocumentImportOptions
.Mht .Encoding
Office File API RichEditDocumentImportOptions
.Mht .Encoding

Remarks

Set the HtmlDocumentImporterOptions.AutoDetectEncoding property to false to disable automatic encoding, and then specify the Encoding property, as shown below:

RichEditDocumentServer wordProcessor = new RichEditDocumentServer();

HtmlDocumentImporterOptions htmlImporterOptions = wordProcessor.Options.Import.Html;
htmlImporterOptions.AutoDetectEncoding = false;
htmlImporterOptions.Encoding = Encoding.UTF8;

wordProcessor.LoadDocument("Documents//Doc1.html", DocumentFormat.Html);
See Also