You can use a home-cooked version of ExtractFileName
, like this:
function ExtractFileNameW(FullPath:WideString):WideString;
var i,pos:Integer;
begin
// Find the last path separator
pos := -1;
for i:=Length(FullPath) downto 1 do
if (FullPath[i] = '/') or (FullPath[i] = '\') then
begin
pos := i;
Break;
end;
if pos = -1 then
Result := FullPath
else
begin
Result := '';
SetLength(Result, Length(FullPath) - pos);
System.Move(FullPath[pos+1], Result[1], (Length(FullPath) - pos) * SizeOf(WideChar));
end;
end;
... but if you really need to deal with Unicode characters you should upgrade to XE. It really makes a lot of difference.