Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: XE6: filename with special characters on os/x


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Sep 21, 2014 5:03 PM Last Post By: Remy Lebeau (Te...
Greg Fr

Posts: 1
Registered: 12/11/04
XE6: filename with special characters on os/x  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 21, 2014 4:11 AM
Hello everyone,

On OS/X plateform, the following code does not work if the filename contains OS / X special characters. However , everything is ok if the file contains only standard characters. Any idea?

OpenDialog1.Filter := 'Fichiers PDF|*.pdf';
if (OpenDialog1.Execute) then
begin
if TFile.Exists(OpenDialog1.FileName) then
begin
source_filename := TPath.GetFileName(OpenDialog1.FileName);
end
else
begin
// problem
end;
end;

thanks,
Greg
Chris Rolliston

Posts: 332
Registered: 4/6/00
Re: XE6: filename with special characters on os/x  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 21, 2014 9:51 AM   in response to: Greg Fr in response to: Greg Fr
On OS/X plateform, the following code does not work if the filename contains OS / X special characters.

Give an example of a filename that fails.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: XE6: filename with special characters on os/x  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 21, 2014 5:01 PM   in response to: Chris Rolliston in response to: Chris Rolliston
Chris wrote:

Give an example of a filename that fails.

Especially considering that the filename is coming from an OpenDialog, so
it should only be returning valid filenames.

--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: XE6: filename with special characters on os/x  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 21, 2014 5:03 PM   in response to: Greg Fr in response to: Greg Fr
Greg wrote:

On OS/X plateform, the following code does not work if the filename
contains OS / X special characters.

Which part does not work exactly? OpenDialog1.Execute(), TFile.Exists(),
or TPath.GetFileName()? Please be more specific.

if TFile.Exists(OpenDialog1.FileName) then

If this is the failure, do you have the same problem with SysUtils.FileExists()?

source_filename := TPath.GetFileName(OpenDialog1.FileName);

If this is the failure, do you have the same problem with SysUtils.ExtractFileName()?

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02