emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multibyte and unibyte file names


From: Stefan Monnier
Subject: Re: Multibyte and unibyte file names
Date: Wed, 23 Jan 2013 16:09:18 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> Let me start with a question: do file primitives need to support
> unibyte file names, as well as multibyte ones?

[ Oh no, not this mess!  ]

> If dst[] is an encoded string that uses a multibyte encoding, it is
> wrong to look at just the last byte of the string, because it could be
> a trailing byte of some multibyte sequence, right?

In theory, yes.  In practice it doesn't seem to be too much of
a problem, tho it could become more serious if we start using utf-16 for
Windows.

Part of the problem is that not all systems agree on whether a file name
is a sequence of bytes or a sequence of characters.

I think that for w32 it makes sense to try and always decode file names
before returning them to Elisp:
Most file names passed to Elisp primitives are derived from file names
returned by Elisp primitives, so if Emacs decodes all the file names it
returns to Elisp, we can expect to see *very* few encoded file names
passed to Elisp primitives.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]