9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] NFD and p9p acme on OSX
Date: Thu, 12 Sep 2013 10:17:57 -0400	[thread overview]
Message-ID: <5597aeb2af08782d984e2a59b4c6775d@brasstown.quanstro.net> (raw)
In-Reply-To: <CALAsyW214kXxW+jtnac072Didn2xh2UBXN8QU4pHfBf1V6=79A@mail.gmail.com>

On Thu Sep 12 05:41:19 EDT 2013, vanattenmark@gmail.com wrote:
> Running p9p on OSX, I find it useful to put this in my rc profile:
>
> fn ls {
> builtin ls $* | iconv -f UTF8-MAC -t UTF-8
> }
>
> fn lc {
> builtin lc $* | iconv -f UTF8-MAC -t UTF-8
> }
>
> so as to deal with the NFD used by the OSX file system and list
> names containing non-ascii characters correctly.
>
> But this doesn't solve the corresponding problem when clicking B3 to
> open a directory in acme.
>
> Am I overlooking something? If not, what do people use to deal with
> this---perhaps a patch to lib9?

i created something similar for plan 9.  it uses runecompose
(see runeclass(2), http://9atom.org/magic/man2html/2/runeclass)
this uses tables built by awk scripts directly from unicodedata.txt.
there is a rune/compose (see rune(1), http://9atom.org/magic/man2html/1/rune)
that makes it possible to write
	fn lc {builtin lc $* | rune/compose}

but i agree, one would like a more systemic solution.  cooking this
into stat/wstat wouldn't work, because the file name text might escape
p9p and cause the rest of the system to be confused.

perhaps runecompose and runedecompose (or equivalent) could be
cooked into fullrune, chartorune, runetochar, etc.  (for apple oses only?)
the big pain point would be dealing with the fact that chartorune
could create up to maxcombiners*4 bytes of utf-8, and fullrune might
need that size buffer to convert one rune.  it's easy to grep for these
use cases.

- erik



  reply	other threads:[~2013-09-12 14:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12  9:40 Mark van Atten
2013-09-12 14:17 ` erik quanstrom [this message]
2013-09-14  9:51   ` Mark van Atten

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

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

  git send-email \
    --in-reply-to=5597aeb2af08782d984e2a59b4c6775d@brasstown.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /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.
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 NNTP newsgroup(s).