mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-10-25 12:41:31 +02:00 
			
		
		
		
	LazFileUtils: Fix FileExistsUTF8 on Windows when FileName contains uncode
characters outside current codepage. git-svn-id: trunk@41283 -
This commit is contained in:
		
							parent
							
								
									0a3ee817e7
								
							
						
					
					
						commit
						0986ec79fe
					
				| @ -1062,10 +1062,7 @@ begin | ||||
|   end; | ||||
| end; | ||||
| 
 | ||||
| function FileExistsUTF8(const Filename: string): boolean; | ||||
| begin | ||||
|   Result:=SysUtils.FileExists(UTF8ToSys(Filename)); | ||||
| end; | ||||
| 
 | ||||
| 
 | ||||
| function FileAgeUTF8(const FileName: String): Longint; | ||||
| begin | ||||
|  | ||||
| @ -36,6 +36,11 @@ begin | ||||
|   InvalidateFileStateCache(Filename); | ||||
| end; | ||||
| 
 | ||||
| function FileExistsUTF8(const Filename: string): boolean; | ||||
| begin | ||||
|   Result:=SysUtils.FileExists(UTF8ToSys(Filename)); | ||||
| end; | ||||
| 
 | ||||
| function ExpandFileNameUtf8(const FileName: string; {const} BaseDir: String = ''): String; | ||||
| var | ||||
|   IsAbs: Boolean; | ||||
|  | ||||
| @ -181,6 +181,17 @@ begin | ||||
|   InvalidateFileStateCache(Filename); | ||||
| end; | ||||
| 
 | ||||
| function FileExistsUTF8(const Filename: string): boolean; | ||||
| var | ||||
|   Attr: Longint; | ||||
| begin | ||||
|   Attr := _FileGetAttrUTF8(FileName); | ||||
|   if Attr <> -1 then | ||||
|     Result:= (Attr and FILE_ATTRIBUTE_DIRECTORY) = 0 | ||||
|   else | ||||
|     Result:=False; | ||||
| end; | ||||
| 
 | ||||
| 
 | ||||
| {******* ANSI functions *******} | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 bart
						bart