paulirwin / JavaToCSharp

Java to C# converter
MIT License
266 stars 90 forks source link

`%20` in `Path.AbsolutePath` results in `DirectoryNotFoundException` on Windows. #80

Closed NumbGnat closed 11 months ago

NumbGnat commented 12 months ago

Describe the bug

On the Windows platform, calling File.ReadAllTextAsync() with an Path.AbsolutePath that contains spaces, represented by %20, results in a System.IO.DirectoryNotFoundException being thrown.

To Reproduce

Steps to reproduce the behavior:

  1. Run the application
  2. Click the [...] button to select a file or folder.
  3. Attempt to open a file, in a location that contains a space in one of the folders of its path.
  4. Notice the error...

Expected behavior

Processing should proceed normally.

Screenshots

Screenshot 2023-10-08 162543

Environment

Additional context

If I manually replace the %20s with spaces, the file loads successfully.

If I paste the AbsolutePath containing the %20s into Windows File Explorer, it generates the same error.