[DUG] FindFirstFileW and UNC paths

Ross Levis ross at stationplaylist.com
Wed Feb 27 17:42:05 NZDT 2013


This one was resolved, sort of.  The function is working correctly.  The path being sent to the function had a folder with a + character in it. Well it should have, but the + character had been replaced with a space character.

 

The path is coming from a PHP script on a web server sending to my app via Indy10 TCPServer.  Something is causing the + character to be replaced, either in the PHP script or Indy.  Some more investigation required.

 

From: Ross Levis [mailto:ross at stationplaylist.com] 
Sent: Tuesday, 26 February 2013 7:00 p.m.
To: 'NZ Borland Developers Group - Delphi List'
Subject: FindFirstFileW and UNC paths

 

I’m having a problem getting this function to work with UNC paths.

 

var Name: WideString;

…

Handle := FindFirstFileW(PWideChar(Name), FindData);

 

I’ve tried \\?\computer\share\folder\* <file:///\\%3f\computer\share\folder\*>   and \\?\UNC\computer\ <file:///\\%3f\UNC\computer\> ... which I’ve seen while investigating but that doesn’t work either.  It works fine for drive letters.

 

This is part of a WideFileExists function I’m using in D7.  I have another question where I need to detect if the path is UNC and if so, remove the first “\”.  I’m not sure what D7 does with the copy function.  Can I do

Name := WideString(‘\\?’)+copy(Name,2,MaxWord)  ?

 

Cheers,

Ross.

 

From: delphi-bounces at listserver.123.net.nz [mailto:delphi-bounces at listserver.123.net.nz] On Behalf Of Stefan Mueller
Sent: Tuesday, 26 February 2013 6:30 p.m.
To: 'NZ Borland Developers Group - Delphi List'
Subject: Re: [DUG] Translate diacritic characters to ASCII

 

Just convert it to US-ASCII, all diacritics will be normalized (and other characters like japanese will turn to “?”).

 

procedure TFrameScript.BitBtn1Click(Sender: TObject);

var sw : string;

    sr : RawByteString;

begin

    sw := 'swe:ÀÁÂÃÄÅ - jap:日本 - ger:üöä';

    sr := sw;

    SetCodePage(sr, 20127, true);

    BitBtn1.caption := sr;

end;

 

 


Kind Regards,
Stefan Mueller 
_______________________
R&D Manager
ORCL Toolbox LLP, Japan
 <http://www.orcl-toolbox.com/> http://www.orcl-toolbox.com

 

 

From: delphi-bounces at listserver.123.net.nz [mailto:delphi-bounces at listserver.123.net.nz] On Behalf Of Ross Levis
Sent: Tuesday, February 26, 2013 1:29 PM
To: 'NZ Borland Developers Group - Delphi List'
Subject: [DUG] Translate diacritic characters to ASCII

 

Anyone know if there is a windows function or method to convert diacritic characters to their similar ASCII counterpart, such as all of these get translated to “A”: ÀÁÂÃÄÅ

 

Cheers.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20130227/bd123eca/attachment.html 


More information about the Delphi mailing list