unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mike Gran <spk121@yahoo.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guile Devel <guile-devel@gnu.org>
Subject: Re: [Guile-commits] GNU Guile branch, string_abstraction2, updated. fc50695e8d6a5cc0cebc3a8fcd0833ec1ff316a2
Date: Sun, 07 Jun 2009 21:51:33 -0700	[thread overview]
Message-ID: <1244436693.2499.12953.camel@localhost.localdomain> (raw)
In-Reply-To: <87d49hqywf.fsf@gnu.org>

On Sat, 2009-06-06 at 15:23 +0200, Ludovic Courtès wrote:
> Hi Mike,
> 
> Mike Gran <spk121@yahoo.com> writes:
> 
> > It would make things easier to follow, but, pure 7-bit ASCII would hurt
> > backwards compatibility.  The libunistring conversion funcs do raise
> > errors when 8-bit chars are converted into ASCII.  ISO-8859-1 could be
> > better so that 8-bit chars wouldn't cause errors by default.
> 
> Right, Latin-1 would be saner.
> 

Setting a port's default encoding to Latin-1 doesn't work out so well in
practice.  For example, ports are used as the backend of procedures like
with-input-from-file and with-output-to-string.  Those procedures don't
currently take any encoding information and presume some sort of default
encoding.

Once could easily imagine a case where the locale is set to en_US.UTF-8
and then with-input-from-file is called.  If non-Latin-1 characters
appear in the file, the port will throw a conversion error.  I think
that would violate the principle of lease surprise.

I prefer having a port inherit its default encoding from the last call
to setlocale.  This isn't a violation of R6RS Port I/O, since it states
that the "native" transcoding may be both implementation dependent and
locale-dependent.

Less preferable, IMHO, is to modify all the with-input-from-* and
with-output-to-* procedures to take optional explicit encodings.

Thanks,

Mike 




  reply	other threads:[~2009-06-08  4:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1MCZex-00070s-SB@cvs.savannah.gnu.org>
2009-06-05 14:10 ` [Guile-commits] GNU Guile branch, string_abstraction2, updated. fc50695e8d6a5cc0cebc3a8fcd0833ec1ff316a2 Ludovic Courtès
2009-06-05 14:26   ` Mike Gran
2009-06-06 13:23     ` Ludovic Courtès
2009-06-08  4:51       ` Mike Gran [this message]
2009-06-18 20:18         ` 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://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=1244436693.2499.12953.camel@localhost.localdomain \
    --to=spk121@yahoo.com \
    --cc=guile-devel@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.
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).