Unicode normalization on the file/directory names?

40 views
Skip to first unread message

Alejandro Exojo

unread,
May 4, 2016, 6:08:39 AM5/4/16
to osxfus...@googlegroups.com
Hi.

I did not find any mentions of Unicode normalization issues in the bug
tracker or messages in the group, but I've had some problems.

My filesystem maps content in a remote server to the local computer.
When the remote side had a folder named "Årstider", browsing that
folder in Finder wasn't possible. Finder was asking my application
that path name in Unicode decomposed form, so the "Å" was "A" +
"circle above", even though the path I was telling in the readdir
operation was in the original composed form, so the "Å" is one
character only. I've fixed that normalizing all input strings to
composed, and that worked. The folder is browsable.

Now I get an even surprising and hard to reproduce problem, and is
that Finder is showing that folder twice... sometimes. I haven't been
able to reproduce that in a console, but it might be a Finder only
issue. I'm attempting the opposite now: decomposing all strings in the
readdir operation so the OS gets the strings as it's used to on OS X
(as far as I know). This is really hard to tell if it's working or if
just not triggering the issue, which seems to appear randomly without
the fix.

Any ideas?

Thank you.

Nickolay Olshevsky

unread,
May 4, 2016, 9:17:48 AM5/4/16
to osxfus...@googlegroups.com
Hi Alejandro,

I had exactly the same problem within my implementation.
Solution was to convert all input from server to the decomposed format.
I.e. everything which goes to the FUSE layer from my application is in
decomposed UTF-8 mapping.
In Objective-C it is [NSString decomposedStringWithCanonicalMapping], in
other languages should be corresponding alternative which normalizes string.
--
Best regards,
Nickolay Olshevsky

Alejandro Exojo

unread,
May 5, 2016, 12:09:33 PM5/5/16
to osxfus...@googlegroups.com
On 4 May 2016 at 15:17, Nickolay Olshevsky <o.nic...@gmail.com> wrote:
> I had exactly the same problem within my implementation.
> Solution was to convert all input from server to the decomposed format.
> I.e. everything which goes to the FUSE layer from my application is in
> decomposed UTF-8 mapping.
> In Objective-C it is [NSString decomposedStringWithCanonicalMapping], in
> other languages should be corresponding alternative which normalizes string.

Thank you Nickolay. I've used Qt's
QString::normalized(NormalizationForm_D) in my case. It's a bit hard
to tell if this is really working, but yes, after some time of staring
at a Finder window I haven't seen it happenning.

I wonder how come this has not appeared yet in the group or the issues.

Thank you.
Reply all
Reply to author
Forward
0 new messages