Encoding issue comparing Mac and Win file names

I’m trying to compare the name of some files (copied from Mac to Win) both in Windows and Mac.

Despite the use of DefineEncodings or ConvertEncodings the name is always different at binary level (reading - display is fine and both are UTF8). I would need to save the name online into a MySQL database to later retrieve and compare from Mac and Win systems.

Have tried with FolderItem.Name and DisplayName without luck. Please notice that it should work on different languages (accents, etc).

I’m sure it’s easy but I’m stuck at this. Thanks.

As far as I remember this is a matter of using precomposed versus decomposed unicode. You need to normalise your strings.

Thanks Beatrix for pointing me in the right direction.

I have used Text comparison feature instead of strings like advised by Michel B. in https://forum.xojo.com/26510-two-identical-strings-not-identical
It seems that FolderItem.Name.ToText can be used on both systems to get same result.

Beatrix. Would you elaborate on what is precomposed versus decomposed?
I have a problem with file names matching on differentvplatforms

Excellent article on Wokipedia about precomposed and decomposed :

Whenever you risk encountering the two forms, use the Text datatype, which is able to validly compare precomposed and e+accent, for instance.