unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 26353@debbugs.gnu.org
Subject: bug#26353: VFS name encoding
Date: Thu, 1 Jun 2017 12:57:43 +0200	[thread overview]
Message-ID: <20170601125743.6b13cd94@scratchpost.org> (raw)
In-Reply-To: <87fugo1efp.fsf@gnu.org>

Hi Ludo,

> The problem of how to deal with file name encoding has been discussed on
> the Guile side so hopefully the next release in the 2.2 series will have
> a solution for this.

For what it's worth, I think the sane solution is the Plan 9 solution:  Just represent file names as bytevectors.  Programs which don't care about the actual name - for example programs that just want to do (for-each unlink (scandir (string->utf8 "."))) or something - have no reason to care about the encoding at all.  And then use UTF-8 encoding everywhere (for the file names, also for everything else) throughout the operating system for the tools that do care.

There are also utf8 mount options in the Linux kernel to be able to present UTF-8 names to userspace even when the actual names on disk are something else - and we should use them.  (I think we should even modify <file-system> flags to default to "utf8" or "iocharset=utf8" where possible)

This conversion of UTF-8 to UCS-4 especially is really just busywork.  My opinion changed over the years - earlier I was all for UCS-4.  But actually, most tools don't care about the actual content of the file names - it's just an opaque ID to them (similar to an UUID).  Representing them as something else in userspace again (inviting another conversion failure) is just ... unnecessary. 

In any case, it would be different if we had a non-UNIX kernel underneath.  But as long as we do have UNIX the kernel VFS interface expects bytevectors, preferrably interpreted as UTF-8 (if interpreted at all).

I think this is also the consensus among the major Linux distributions and also among lowlevel libraries like glib: They assume one is using UTF-8 filenames and default to it whereever possible.

  reply	other threads:[~2017-06-01 10:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03 18:56 bug#26353: GuixSD /tmp cleaner fails to clean when Umlauts like "ä" are used in filenames Danny Milosavljevic
2017-04-12 13:04 ` Ludovic Courtès
2017-04-22 23:30   ` Ludovic Courtès
2017-04-23  0:14     ` Danny Milosavljevic
2017-05-01 14:51       ` bug#26353: TeX Live Ludovic Courtès
2017-05-01 15:11         ` Marius Bakke
2017-05-01 21:24           ` Ludovic Courtès
2017-06-01 11:17             ` ng0
2017-05-02  6:31         ` Ricardo Wurmus
2017-06-02  8:32           ` Ricardo Wurmus
2017-06-02 15:06             ` Ludovic Courtès
2017-06-03 19:14               ` Ricardo Wurmus
2017-04-23  2:03     ` bug#26353: GuixSD /tmp cleaner fails to clean when Umlauts like "ä" are used in filenames Danny Milosavljevic
2017-05-01 20:59       ` Ludovic Courtès
2017-06-01 10:57         ` Danny Milosavljevic [this message]
2017-06-01 11:28           ` bug#26353: VFS name encoding Ludovic Courtès
2017-12-14 22:28         ` bug#26353: GuixSD /tmp cleaner fails to clean when Umlauts like "ä" are used in filenames Danny Milosavljevic
2017-12-15 10:27           ` Ludovic Courtès
2018-06-09  9:30             ` Danny Milosavljevic
2018-06-20  8:07               ` Ludovic Courtès
2018-06-19 20:17           ` Nils Gillmann
2018-06-19 20:47             ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170601125743.6b13cd94@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=26353@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).