[Lazarus] Opening a file with spaces in the filename (again)

Bart bartjunk64 at gmail.com
Tue Mar 5 18:49:18 CET 2013


On 3/5/13, John <jszcmpr at netspace.net.au> wrote:

> I want to open a tiff file using what ever viewer the PC knows about
> that can do it (it will be irfanview on the test PC).  It seemed that
> "OpenDocument"  is the appropriate method.  This works fine so long as
> the path has no spaces, but OpenDocument calls OpenURL, and that
> converts the spaces to %20 s

In trunk it does not replace spaces with %20.
This was reverted in r36934.

Opne ($Lazarus)/cl/include/sysenvapis_win.inc and simply remove the line

 if Pos(' ', AURL) > 0 then
 	AURL := StringReplace(AURL, ' ', '%20', [rfReplaceAll, rfIgnoreCase]);

from OpenUrl() function and then rebuild your application (LCL should
be rebuilt automatically).

r36934. should probably be merged to fixes branch.


@Reinier: this part of the reverting has nothing to do with Win9x
compatibility, it would fail on Win7 as well.


The Win9x discussion was about quoting the file:// URI scheme.
But on Windows you should probably not use this, because Windows does
not have a default handler for file:// URI scheme and simply looks at
the extension.

Bart




More information about the Lazarus mailing list