wxMac 2.8.7: problem reading date of files with unusual chars
in file name
Fulvio Senore
mailing at fsoft.it
Tue Feb 5 05:17:34 PST 2008
I have very little experience with OSX, so I do not know anything about
encoding and similar things.
Anyway, it looks like GetModificationTime() does not work correctly with
filenames containing accented letters in OSX. If confirmed, this looks
like a bug to me and I think that it would be nice if it were fixed.
I suppose that I could find a workaround using native calls, but this is
against the spirit of wxWidgets.
Fulvio Senore
Paul Koning ha scritto:
> What you were seeing is a case of mixing up my mailing lists... :-(
>
> Anyway, it may be that you have the same sort of problem here: something is changing the encoding of the name string, and OSX insists on exactly one encoding which isn't the one you're getting.
>
> If you have a way to generate them, try encoding the name with separate accents, and also encoding it as a combined character with accent in a single code. I think you'll find that one of these works and the other does not.
>
> paul
>
> -----Original Message-----
> From: Fulvio Senore [mailto:mailing at fsoft.it]
> Sent: Monday, February 04, 2008 3:00 PM
> To: wx-users at lists.wxwidgets.org
> Subject: Re: wxMac 2.8.7: problem reading date of files with unusual chars in file name
>
> I am not sure that I understand what you have written. Is SVN just an
> example?
>
> Anyway, if I look at the same files with the Finder I can see them
> correctly, so I suppose that it should be possible to do the same with
> wxWidgets. Am I missing anything?
>
> Fulvio Senore
>
> Paul Koning ha scritto:
>
>> SVN has trouble with some names on OSX. The issue is that some characters (like "è") can be encoded in Unicode in two ways. OSX insists on one; SVN either insists on the other, or at least modifies the encoding somewhere. The result is no match.
>>
>> That's an OSX bug: any file system, and especially a case-insensitive file system, should accept any of the valid Unicode encodings of a given character as equivalent.
>>
>> paul
>>
>> -----Original Message-----
>> From: Fulvio Senore [mailto:fulvio at fsoft.it]
>> Sent: Monday, February 04, 2008 1:16 PM
>> To: wx-users at lists.wxwidgets.org
>> Subject: wxMac 2.8.7: problem reading date of files with unusual chars in file name
>>
>> I am using the following code to read info about the files contained in
>> a folder:
>>
>>
>> wxDir dir(path);
>> bool cont = dir.GetFirst(&fileName, wxT(""), wxDIR_FILES );
>> while( cont ) {
>> wxFileName fn( path, fileName );
>> CFiles file;
>> file.FileName = fileName;
>> file.FileExt = fn.GetExt();
>> file.DateTime = fn.GetModificationTime();
>> file.FileSize = fn.GetSize();
>> file.PathID = pth.PathID;
>> file.PathFileID.SetNull(true);
>> file.DbInsert();
>> cont = dir.GetNext(&fileName);
>> }
>>
>>
>> This code works well in Linux and Windows. In OSX, if one or more file
>> names contain letters like "èéà°" I receive errors saying:
>>
>> "failed to retrieve file times for <file name> (error 2: no such file or
>> directory)"
>>
>> if the file name does not contain those letters the program works
>> without problems.
>>
>> I have verified that the line that causes the problem is the one that
>> calls the GetModificationTime() function.
>>
>> It looks like those letters are not handled correctly.
>>
>> Best regards
>>
>> Fulvio Senore
>>
>>
More information about the wx-users
mailing list