On Mon, Sep 17, 2018 at 6:52 PM Alistair Grant <[email protected]> wrote:
> Hi Esteban, Guille and Everyone, > > I haven't looked at using FFI much, however it is easy to imagine that > different file encoding rules on different platforms will make writing > FFI calls more difficult, Well not really (from my point of view :)) >From the point of view of the FFI call an encoded string is just a bunch of bytes. FFI does not do any interpretation of them. > i.e. some of the different formats are: > > - OSX uses Mac specific decomposed UTF8 encoding > - Windows uses Wide Strings (16 bit Unicode characters) > - Linux allows pretty much anything, but precomposed UTF8 is common > > At the image side, we could have an strategy that, depending on the OS, could encode in one encoding or another, or even not encode at all. > Believe it or not, I'm still working on getting the > FileAttributesPlugin working (file name encoding on Windows being the > latest issue - the tests in Pharo need to be extended). > I believe you, don't worry ^^. > Would it be useful for future FFI work to have primitives available > which convert file names to and from the various platform specific > formats? (Linux is basically a no-op, and Windows could be written > in-image, but OSX requires the platform routines to be called). > Maybe... Are the OSX routines exposed as C functions (that we can call through FFI) or they are objective-C methods/functions (that are more complicated to map)? Thanks Alistair!
