I need to compare strings containing file names returned by code like this:
final assetManifest = await AssetManifest.loadFromAssetBundle(rootBundle);
final assets = assetManifest.listAssets();
with strings retrieved from an SQLite database.
On macOS, file names use Unicode NFD encoding, while SQLite stores text in Unicode NFC encoding.
Everything works fine unless the file names contain special national characters like "ä", "ö", etc.
The two encoding formats handle such characters differently, which causes string comparisons to fail, even when the visual representation of the file names is identical.
For example, "Bär.png" (from the file system) does not match "Bär.png" (from an SQLite table column).
In my app, I cannot rename the files to avoid this issue because the file names must match the spelling of words in the relevant national language.
Therefore, I need a way to convert NFD strings to NFC before performing comparisons.
Unfortunately, I couldn't find any Dart package capable of handling this conversion.
Before resorting to writing my own conversion function, I’d like to know if there is an existing solution for this task.
Thank you for help.