Bug 3860 - DirectoryInfo.GetFileSystemInfos returns a subdirectory that has unicode chars with the incorrect name
Summary: DirectoryInfo.GetFileSystemInfos returns a subdirectory that has unicode char...
Status: RESOLVED INVALID
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 2.10.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-03-12 15:03 UTC by Jared Watts
Modified: 2012-03-16 06:06 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
C# file that repros the incorrect name of a unicode sub dir being returned (3.72 KB, text/plain)
2012-03-12 15:03 UTC, Jared Watts
Details
Sample output from running the repro program on OS X (202 bytes, application/octet-stream)
2012-03-12 15:04 UTC, Jared Watts
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Jared Watts 2012-03-12 15:03:01 UTC
Created attachment 1501 [details]
C# file that repros the incorrect name of a unicode sub dir being returned

This only repros on Mac.

Repro steps:
1) Create a subdirectory with unicode chars ("ベートーヴェン") using Directory.CreateDirectory
2) Retrieve the just created subdir with DirectoryInfo.GetFileSystemInfos
3) Check the Name property of the retrieved subdir

Expected: The name of the subdir to match the name it was created with
Actual: The name of the retrieved subdir is different

See the attached repro program that demonstrates this behavior.

To build the attached repro program:
csc /t:exe /out:UnicodeFileRepro.exe Program.cs
Comment 1 Jared Watts 2012-03-12 15:04:41 UTC
Created attachment 1502 [details]
Sample output from running the repro program on OS X

This is sample output from running the repro app, it shows the expected name of the subdirectory and the actual name retrieved at runtime (including the hex equivalent of their encoded bytes)
Comment 2 Atsushi Eno 2012-03-16 06:06:31 UTC
Invalid as explained in http://lists.ximian.com/pipermail/mono-devel-list/2012-March/038662.html

The underlying OS does not return your non-normalized name string which could have other variants. Suppose you created a folder "Foo" on insensitive file system, it may return "foo" for GetFileSystemInfos().