Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxHtmlDocumentImporterOptions.Encoding Property

Specifies the character encoding used to interpret characters in an imported HTML document.

#Declaration

Delphi
property Encoding: Word read; write; default CP_UTF8;

#Property Value

Type Default Description
Word CP_UTF8

The target character encoding.

#Remarks

Use the Encoding property to specify the target character encoding explicitly when the AutoDetectEncoding property is set to False.

The following code example loads an HTML document with the explicitly specified UTF-7 encoding:

var
  ADocumentServer: TdxRichEditDocumentServer;
begin
  ADocumentServer := TdxRichEditDocumentServer.Create(nil);
  ADocumentServer.Options.Import.Html.AutoDetectEncoding := False;
  ADocumentServer.Options.Import.Html.Encoding := CP_UTF7;
  ADocumentServer.LoadDocument('Document1.html');
  // ...
  ADocumentServer.Free;
end;

The Encoding property’s default value is CP_UTF8.

See Also