
You can also make use of Scripting.Filesystemobject, if also setting SYS(3101) to translate into something reversable to unicode, eg to retrieve UTF-8: F., but ADIR(laFile,'-VERSI~1.TXT') finds it and returns 1, FOPEN('-VERSI~1.TXT') can open I created a file 'd:\temp\α-version.txt' and using ADIR(laFile,'*version.txt','',2) get back -VERSI~1.TXT as the DOS name. Nevertheless, there is a way to get a ascii file name via the ADIR option to retrieve DOS8.3 format file names, which also Win7 still hands out. So you'd have to begin with your source code, rather using STRCONV() or similar to get from ANSIĬode/text to a variable value holding unicode to use with Win API unicode file functions. Obviously you can't write a UNICODE string literal in a prg, as also prg files have a codepage, which can differ from country to country, but not be unicode. I don't even see unicode characters in your posting!? So, for me it looks as if you cannot detect Unicode chars in a file name. m.ls1 = ""m.lobj2 = gofs.GetFolder("C:\Program Files\Microsoft Visual FoxPro 9\AAA")m.lobj3 = m.lobj2.FilesFOR EACH afile IN m.lobj3 m.ls3 = "" m.ls2 = "" m.ls1 = afile.NameğOR m.ln1 = 1 TO LEN(m.ls1) m.ls3 = m.ls3 + CHR(ASC(SUBSTR(m.ls1, m.ln1, 1 ))) m.ls2 = m.ls2 + SUBSTR(m.ls1, m.ln1, 1) + " is " & Display a character try m.ls2 = + m.ls2 + STR(ASC(SUBSTR(m.ls1, m.ln1, 1 )),4,0) + CS_CRLF & Display ANSI value CATCH m.ls2 = + m.ls2 + "?" + CS_CRLF ENDTRYĞNDFOR MESSAGEBOX(m.ls2 + CS_CRLF + m.ls3)NEXTRELEASE lobj2, lobj3 m.ls1 = "Found"TRY* unicode file namem.gofs = CREATEOBJECT("Scripting.FileSystemObject")m.lobj2 = gofs.GetFile("C:\Program Files\Microsoft Visual FoxPro 9\AAA\P-1-8-PC-RP-0_C.txt")CATCH m.ls1 = "Not Found"ENDTRYWAIT WINDOW "Type is " + VARTYPE(lobj2) + " " + m.ls1 & L = logical or O = objectRELEASE lobj2, gofsĮven using the GetFolder() method and iterating through the Files collection using ASC() on each Char in the file name did not detect it.

So a subsequent FILE() does not find a match.Įven the low level File System Object and its GetFile method did not find it with a hard coded file name. So the filename is "changed" into ANSI code.
#OPEN UNICODE FILE CODE#
GetFile() will list the file, but when selected it seems to automatically convert the Unicode hypen to ANSI/ASC code 45 for a hypen.

#OPEN UNICODE FILE WINDOWS#
Your file name shows small squares in place of the - hypen under Windows Explorer.Īs you stated File() does not find the file.
