Re: msdosfs: Lookup of some existing files fails when mounting with long names

[email protected] Thu, 21 May 2026 23:56:05 +0200
Newsgroups gmane.os.freebsd.devel.hackers
Message-ID <[email protected]>
Am 21.05.26 um 17:11 schrieb Peter Pentchev:
> On Thu, May 21, 2026 at 11:31:27AM +0200, Fabian Keil wrote:
>> I recently got an USB stick which contains a bunch of mp4 files
>> that I want to watch on an ElectroBSD amd64 system currently based
>> on stable/15 b718f7d881.
>>
>> Unfortunately some of the files can't be looked up when
>> mounting the file system with long file names (the default).
>>
>> The stick could be copied to a file without problems and the
>> issue remains reproducible.
>>
>> When the image is mounted with:
>>
>>     fk@t520 ~ $sudo mount_msdosfs -m 640 -M 750 -L de_DE.UTF-8 -u youtube -o ro -l /dev/md0p1 /mnt/datentausch/
> [snip]
>> Mounting the file system without the -L option results in even
>> more lookup failures.
> 
> So this is totally a wild guess, but can you try it with the -L option,
> but specifying a single-byte locale, e.g. de_DE.ISO8859-15?
No, could have been, but it was something else ... ;)

Fabian sent me the relevant part of the image, and the name
that is not correctly displayed contains the following UTF-16
sequence:

	U+D83E U+DD10 ===> U+1F910 ===> "🤐"

Seems that the conversion of these combined UTF-16 sequences
(surrogates) is not correct. This will probably affect all
file names that contain Unicode characters that cannot be
encoded in a single UTF-16 value.

I'm going to further debug this issue tomorrow; it should be
easy to reproduce and fix ...

Regards, STefan