Platform SDK: International Features |
The ScriptRecordDigitSubstitution function reads the National Language Support (NLS) native digit and digit substitution settings and records them in the SCRIPT_DIGITSUBSTITUTE structure.
HRESULT WINAPI ScriptRecordDigitSubstitution( LCID Locale, SCRIPT_DIGITSUBSTITUTE *psds );
Note that context digit substitution is supported only in Arabic and Farsi locales. In other locales, context digit substitution is mapped to no substitution.
If successful, the function returns S_OK.
If psds is NULL, the function returns E_POINTER.
If Locale is invalid or not installed, the function returns E_INVALIDARG.
If any other unrecoverable error is encountered, it is also returned as HRESULT. For example, error returns from Win32 API functions are converted to HRESULT using the HRESULT_FROM_WIN32 macro and returned to the client in the HRESULT.
The typical way to call this function is:
SCRIPT_DIGITSUBSTITUTE sds; ScriptRecordDigitSubstitution(LOCALE_USER_DEFAULT, &sds);
At every itemization, you can use the results like this:
SCRIPT_CONTROL sc = {0}; SCRIPT_STATE ss = {0}; ScriptApplyDigitSubstitution(&sds, &sc, &ss);
For performance reasons you should not call ScriptRecordDigitSubstitution frequently. In particular, it requires considerable overhead to call it every time you call ScriptItemize or ScriptStringAnalyse. Instead, you can save the SCRIPT_DIGITSUBSTITUTE structure and update it only when:
– Or –
Windows NT/2000: Requires Windows 2000.
Header: Declared in Usp10.h.
Library: Use Usp10.lib.
Uniscribe Overview, Uniscribe Functions, ScriptStringAnalyse, ScriptApplyDigitSubstitution, ScriptItemize, SCRIPT_DIGITSUBSTITUTE