vcl-dxcore-63408c03.md
Stores global diacritic mark-related settings for string data comparison operations.
TdxDiacriticStringOptions = class sealed(TObject)
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 your changes.
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.
ComparisonModeAllows 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.
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.
#include <vcl.h>
#include "dxCore.hpp"
#pragma hdrstop
#include <tchar.h>
//-------------------------------------------------------------------------------
USEFORM("Unit1.cpp", TMyForm);
//-------------------------------------------------------------------------------
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
{
try
{
TdxDiacriticStringOptions::ComparisonMode = TdxDiacriticStringComparisonMode::Insensitive;
TdxDiacriticStringOptions::NormalizationMode = TdxDiacriticStringNormalizationMode::System;
// ...
Application->Initialize();
Application->MainFormOnTaskBar = true;
Application->CreateForm(__classid(TMyForm), &MyForm);
Application->Run();
}
// ...
}
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.
Diacritic mark settings have no effect on server mode data controllers and the following lookup editors:
TcxExtLookupComboBoxAn unbound lookup combo box editor that displays a data-aware Table or Banded Table grid View as its drop-down window.TcxDBExtLookupComboBoxA data-aware lookup combo box editor that displays a data-aware Table or Banded Table grid View in its drop-down window.TcxDBLookupComboBoxA data-aware lookup combo box editor.TcxLookupComboBoxAn 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).
TObject TdxDiacriticStringOptions
See Also