Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2023-06

Function for translation "normalized" Unicode strings into strings with composed characters?

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tomas Hajny

Hi *,

Do we have a function in FPC RTL or packages allowing to translate a string containing letters followed with standalone combining characters (diacritics) into the combined alternatives? I assume that the necessary information is available in the UnicodeData unit, thus an alternative might be using information from this unit if no readily available function is available, but I wouldn't know where exactly this information is and how to use it anyway at the moment. :-(

Thanks in advance

Tomas

Reply by email

Denis Kozlov
to Tomas Hajny

The canonic decomposition (NFD) can be performed with UnicodeData.NormalizeNFD function in FPC, but I don't think there is an implementation of canonical composition (NFC) in FPC. It would be great to have one!

On Windows, you can perform both NFD and NFC via NormalizeString API function.
https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-normalizestring

Regards,
Denis

Tomas Hajny wrote 16 lines
Hi *, Do we have a function in FPC RTL or packages allowing to translate a string containing letters followed with standalone combining characters (diacritics) into the combined alternatives? I assume that the necessary information is available in the UnicodeData unit, thus an alternative might be using information from this unit if no readily available function is available, but I wouldn't know where exactly this information is and how to use it anyway at the moment. :-( Thanks in advance Tomas _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email