9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] pipeto.lib spool and encoding
Date: Fri, 19 Oct 2007 14:07:36 -0400	[thread overview]
Message-ID: <ee9e417a0710191107v41e4c0acwe3b234c2532451dd@mail.gmail.com> (raw)
In-Reply-To: <dee4f5559bee2565cb55b251346bdd3a@quanstro.net>

> > in /mail/lib/pipeto.lib, the line
> >
> > sed '/^$/,$ s/^From / From /' >$TMP.msg
> >
> > needs to be replaced with a c program that does this
> > conversion without coercing its input text into utf-8.
> >
> > russ
>
> unfortunately, i think the patch is on the wrong track.
> sed isn't coercing it's input to utf-8.  there's no active
> conversion going on.  plan 9 programs assume utf-8 input,
> since plan 9 uses utf-8.

i said coerce, not convert.  sed is treating its input as utf-8,
like most plan 9 programs, but raw mail messages might be
some other 8-bit ascii-compatible encoding.  so the bytes
that are not valid utf-8 sequences are getting mangled by
the coercion into a Rune buffer.

> i think a better solution to this is to convert the incoming
> message to utf-8 first.  there are likely more problems similar
> to this one as plan 9 tools make valid assumptions that upas doesn't
> honour.

most plan 9 tools are used on the upas presentation of a mailbox,
which *is* in utf-8.  very few tools operate directly on the 8-bit
mail message.  pipeto.lib is one of the few, and even there it
just works to get its input into an mbox and then invokes upas/fs.

attempting to perform any conversion of the raw message is a mistake.
you're almost guaranteed to lose some information, and with little
to no benefit (thanks to everything using upas/fs to access mail).

russ


  reply	other threads:[~2007-10-19 18:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-16 16:01 Matthias Teege
2007-10-18 20:10 ` Russ Cox
2007-10-18 21:07   ` erik quanstrom
2007-10-19 18:07     ` Russ Cox [this message]
2007-10-19 18:22       ` erik quanstrom
2007-10-18 22:22   ` Steve Simon
2007-10-18 22:34     ` geoff

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=ee9e417a0710191107v41e4c0acwe3b234c2532451dd@mail.gmail.com \
    --to=rsc@swtch.com \
    --cc=9fans@cse.psu.edu \
    /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).