Skip to main content
You are viewing help content for pre-release software. This document and the features it describes are subject to change.
All docs
V26.2
  • Diacritic Marks & String Comparison Settings

    • 3 minutes to read

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

    DevExpress data controllers and text box-based editors (TcxCustomTextEdit descendants) treat a base letter with different diacritic marks as different characters for all comparison operations that allow you to search, sort, and filter data.

    Available Options

    The TdxDiacriticStringOptions class implements global settings you can use to change this behavior.

    ComparisonMode
    Allows you to switch between comparison modes.
    NormalizationMode

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

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

    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 your changes.

    Code Example: Configure Global Diacritic Mark Settings at Startup

    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 and Considerations

    Diacritic mark settings have no effect on server mode data controllers and the following lookup editors:

    TcxExtLookupComboBox
    An unbound lookup combo box editor that displays a data-aware Table or Banded Table grid View as its drop-down window.
    TcxDBExtLookupComboBox
    A data-aware lookup combo box editor that displays a data-aware Table or Banded Table grid View in its drop-down window.
    TcxDBLookupComboBox
    A data-aware lookup combo box editor.
    TcxLookupComboBox
    An unbound lookup combo box editor.

    Tip

    You can use database collation options instead of these global diacritic settings if you use Server Mode.

    Available database collation options depend on the SQL server you use. Refer to the corresponding SQL server documentation for details (for example, Collation and Unicode Support in Microsoft SQL Server).

    See Also