emacs-devel
[Top][All Lists]
Advanced

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

Re: fixing url-unhex-string for unicode/multi-byte charsets


From: Boruch Baum
Subject: Re: fixing url-unhex-string for unicode/multi-byte charsets
Date: Sun, 8 Nov 2020 04:12:16 -0500
User-agent: NeoMutt/20180716

On 2020-11-06 17:04, Eli Zaretskii wrote:
> > From: Stefan Monnier <monnier@iro.umontreal.ca>
> > Cc: Boruch Baum <boruch_baum@gmx.com>,  emacs-devel@gnu.org
> > Date: Fri, 06 Nov 2020 09:59:02 -0500
> >
> > My guess is that his `file-name-coding-system` is set to something
> > different from utf-8.

That's correct, kind of. The setting isn't 'mine', its the emacs
default. In both emacs 26.1 (debian) and emacs-snapshot (v28),
file-name-coding-system defaults to nil, and
default-file-name-coding-system defaults to utf-8-unix, so we have:

                 file-name-coding-system  => nil
  (default-value file-name-coding-system) => nil
         default-file-name-coding-system  => utf-8-unix

Anybody besides me find that amusing? It reminds me of Bug report #43294
in that both seem intentionally designed to cause confusion and trip-up
developers.

> > [ BTW, I wouldn't be surprised to hear that the Freedesktop spec
> >   documents that the file names in the Trash should use utf-8, in which
> >   case the code should hard-code utf-8 rather than use
> >   `file-name-coding-system` ;-)  ]
>
> If the trash spec says it must be UTF-8, then yes, TRT is to use that
> unconditionally.

The FreeDesktop.org Trash specification[1] says about the trash restore
PATH:

   "The value type for this key is “string”; it SHOULD store the file
   name as the sequence of bytes produced by the file system, with
   characters escaped as in URLs (as defined by RFC 2396, section 2)."

The RFC says (section 2.1):

   "... there is currently no provision within the generic URI syntax to
   accomplish this identification ... It is expected that a systematic
   treatment of character encoding within URI will be developed as a
   future modification of this specification."

> But if the spec says nothing, I'd expect the file names to be in
> whatever encoding they were on disk, which usually should coincide
> with file-name-coding-system.

[1] https://specifications.freedesktop.org/trash-spec/trashspec-latest.html
[2] http://www.faqs.org/rfcs/rfc2396.html

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0



reply via email to

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