ExpandFileNameUTF8 does not work
Original Reporter info from Mantis: Spike
-
Reporter name: Radu Dan
Original Reporter info from Mantis: Spike
- Reporter name: Radu Dan
Description:
I came across this when selecting a non-ASCII file name within a TOpenDialog, but I think that it affects TSaveDialog in the same manner.
All the non-ASCII characters from the file name were converted to a question mark (?)
Via trial and error, I located the problem to be within the common (non-interface) trunk, dialogs.pp, in the method Dereference from the TOpenDialog class. This method passes all the selected files through ExpandFileNameUTF8, which in turn is a double conversion to ANSI while passing the ansistring to ExpandFileName
I haven't quite figured out where exactly within this process does the filename get garbled (otherwise I would have submited a patch), but I think that this is a big issue for non-unicode filesystems which effectively limits file support.
For any interested user, a quick and dirty fix for this is to add the NoDereferenceLinks option into your TOpenDialog (provided your application does not need it). Doing so will bypass ExpandFileNameUTF8 and will leave your file name(s) the same way the OS reported them.
Mantis conversion info:
- Mantis ID: 14504
- OS: Windows
- OS Build: Vista
- Platform: i386
- Version: 0.9.29 (SVN)
- Target version: 1.0.0
- LazTarget: 1.0