Skip to main content
All docs
V24.1

TdxDiacriticStringOptions Class

Stores global diacritic mark-related settings for string data comparison operations.

Declaration

TdxDiacriticStringOptions = class sealed(TObject)

Remarks

A diacritic mark is a glyph added to a base letter. The majority of European languages uses diacritic marks to stress vowels and designate different sounds for the same base letter in an alphabet.

DevExpress data controllers and text field-based editors treat a base letter with different diacritic marks as different characters for all comparison operations that allow you to search, sort, and filter data. The TdxDiacriticStringOptions class implements global settings you can use to change this behavior.

Tip

We recommend that you configure string comparison settings in the initialization section of the main application as demonstrated in the code example below. If you need to change these settings while the application is running, refresh all data controllers to apply the changes.

Main API Member

The list below outlines key members of the TdxDiacriticStringOptions class. These members allow you to change string data comparison behavior in relation to diacritic marks.

ComparisonMode
Allows you to switch between comparison modes.
NormalizationMode

Specifies the string normalization algorithm used for string comparison in diacritic-insensitive mode.

Tip

Use this property only if diacritic-insensitive string comparison yields incorrect results for the target language.

Code Example

The following code example configures global diacritic mark-related settings at application startup:

uses
  dxCore;
// ...
begin
  TdxDiacriticStringOptions.ComparisonMode := TdxDiacriticStringComparisonMode.Insensitive;
  TdxDiacriticStringOptions.NormalizationMode := TdxDiacriticStringNormalizationMode.System;
  // ...
  Application.Initialize;
  Application.MainFormOnTaskBar := True;
  Application.CreateForm(TMyForm, MyForm);
  Application.Run;
end.

String Comparison Performance

Compared to the default string comparison mode, diacritic-insensitive string normalization and comparison algorithms are more time-consuming. We recommend that you use the default mode if the performance of string comparison operations is critical for your application.

Limitations

The global diacritic mark-related settings accessible through the TdxDiacriticStringOptions class have no effect on any Server Mode data controller. You can use database collation options instead (Collation and Unicode Support in Microsoft SQL Server, for instance).

Inheritance

TObject
TdxDiacriticStringOptions
See Also