Electron.NET icon indicating copy to clipboard operation
Electron.NET copied to clipboard

ShowOpenDialog doesn't read "+" character in the file names

Open AvinashSuresh12 opened this issue 3 years ago • 1 comments

Hi,

I'm trying to get the selected file details using the ShowOpenDialog method from ElectronDialogWindow. Able to get the selected file paths properly but the file Names having the "+" character are not getting recognized properly.

Current behavior: If the file name is "ab+cd" then it will be read as "ab ab". It's not recognizing the "+" character. Expected behavior: It should recognize the "+" character and read it as "ab+ab".

Does anyone have thoughts about this?

Thanks

AvinashSuresh12 avatar May 11 '22 04:05 AvinashSuresh12

I think this a bug in Electron.NET.

The showOpenDialog command is send to the ElectronNET.Host. ElectronNET.Host calles the showOpenDialog And sends the results back to ElectronNET.API.

The ElectronNET.API transforms the paths with an HttpUtility.UrlDecode, but the paths are not UrlEncoded.

When HttpUtility.UrlDecode is called on ab+bc the result is ab bc. But when HttpUtility.UrlDecode is called on ab-bc the result is ab-bc, therefor it was never noticed before. I think.

@GregorBiswanger could you please confirm this? I can then create a merge request for it.

Bmooij avatar Jul 28 '22 12:07 Bmooij