- Rolf Knaden
- PowerBuilder
- Wednesday, 5 January 2022 01:33 PM UTC
Hi.
I have problems to get the correct utf-filename of files, dropped to may window.
I am using DragQueryFileA to get the filenames, that are dropped to my window. It is implemented like this:
function ulong DragQueryFileA( ulong ul_Drop, ulong ul_index, ref string LPTSTR, ulong cb ) LIBRARY "shell32.dll" alias for "DragQueryFileA;Ansi"
In that implementation, DragQueryFileA provides the Ansi-names.
But I have filenames with german special characters like this "C:\temp\MeinMülleimer.png" dropped.
The name provided by DragQueryFileA then is "C:\temp\MeinMu¨lleimer.png".
If already remove the "...;Ansi" in the external function.
Then I get a string like this "㩃瑜浥屰敍湩畍沨敬浩牥瀮杮" (think it's 3-byte-characters).
I have written a small function to convert the value:
string ls_filename
ls_filename = string( blob(as_filename, EncodingUTF16LE! ), encodingUTF8! )
This returns ls_filename like that: "C:\temp\MeinMu¿lleimer.png", which also is not the correct name.
How do I get the correct name of the dropped file?
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.