[Openmcl-devel] special characters in filenames - Carbon support
Erik Huelsmann
ehuels at gmail.com
Thu Aug 9 04:12:22 PDT 2007
On 8/9/07, Gary Byers <gb at clozure.com> wrote:
> > Hi,
> >
> > I use openMCL 1.1 on an Intel Mac. I want to read and write files with
> > special characters in the file name like "ä". Is this possible? E.g., I load
> > a file made with Aquamacs from a terminal shell (load "myfile"). It contains
> > a line like
> >
> > (probe-file "/Users/thomashummel/ändern.lisp")
> >
> > It doesn't find the file although the file exists at this place.
>
> At least on OSX, things like OPEN and PROBE-FILE really should encode
> namestrings in UTF-8 before passing them off to the file system. (I'm
> pretty sure that this is true regardless of the file system type, and
> that some VFS layer handles the issue of mapping UTF-8 pathnames to
> whatever native convention the filesystem supports, handling decomposition/
> precomposition, etc.)
> I suspect that this is also true of FreeBSD (where
> some of the VFS ideas came from);
Well, I've just submitted a patch to the APR project [the Apache
portability layer; a dependency for these projects:
http://apr.apache.org/projects.html] to achieve the result described
above for OSX.
But on all other *nix, it uses the value of LC_CTYPE to determine what
encoding the paths should be created. (This - I've been told - is a
convention which originates from Solaris.)
> I'm not sure that it's true of Linux,
> where a filename is probably just an arbitrary, NUL-terminated sequence
> of octets (and no assumptions are made about how those octets relate
> to any character encoding.)
> None of this (UTF-8 conversion) currently happens. Since OSX expects
> UTF-8, the presence of the single 8-bit character in your example just
> makes the namestring look like poorly encoded UTF-8 and things don't work ...
> Fixing this (by changing the half-dozen or so things that pass namestrings
> to/receive namestrings from the OS to assume that those namestrings are
> UTF-8 encoded) is fairly straightforward and is clearly the right thing
> for OSX (and probably FreeBSD). Does anyone have a sense of whether
> this would be the right thing for Linux as well ? (E.g., whether Linux
> namestrings that contain non-ASCII characters are usually in fact
> UTF-8 encoded or not ?)
>
> >
> > Too, it is said that openMCL supports Carbon. For example, how can I invoke
> > the Carbon function FSRenameUnicode (in Digitool CL it was (#_FSRenameUnicode
> > ....)
>
> OpenMCL on Intel hardware is currently only available as a 64-bit
> application. Apple has not provided 64-bit versions of any GUI libraries
> to date and has announced that the forthcoming Leopard release will
> provide a 64-bit version of Cocoa but not of Carbon.
>
> People have done things with Carbon and OpenMCL on PPC32 in the past.
HTH,
Erik.
More information about the Openmcl-devel
mailing list