[DUG] FindFirstFileW and UNC paths

Ross Levis ross at stationplaylist.com
Tue Feb 26 18:59:38 NZDT 2013


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\*  and \\?\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/20130226/18c39420/attachment.html 


More information about the Delphi mailing list