unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-devel@gnu.org
Subject: Re: Internal visibility
Date: Wed, 11 Jun 2008 09:49:26 +0200	[thread overview]
Message-ID: <87r6b42yyh.fsf@ambire.localdomain> (raw)
In-Reply-To: <878wxdze2q.fsf@gnu.org> ("Ludovic Courtès"'s message of "Tue, 10 Jun 2008 14:09:33 +0200")

() ludo@gnu.org (Ludovic Courtès)
() Tue, 10 Jun 2008 14:09:33 +0200

   Currently, Guile only supports `scm_to_locale_string ()', which means
   the returned C string is encoded in the current locale's encoding.
   Eventually, new functions may be added: `scm_to_utf8_string ()', etc.
   This was Marius' original plan [0], and I think it remains valid.

Most plans are "valid" but not all plans are easy to live with.

I think the encoding of a string (or buffer or "character" array
(or subsequence thereof)) needs to be explicit; the encoding is
not purely "internal" and to treat it as such will require hoop-
jumping on both sides of the API.  (How encoding support is
implemented, on the other hand, is indeed an internal affair.)

This is from observation of how Emacs attained multibyte-ness.
Note: not just "how Emacs does it" but "how Emacs used to not do
it and through time eventually came to do it".

In PostgreSQL's multibyte support, the i/o can be tempered by
setting the "client encoding".  This can be changed cheaply (per
request).  Basing encoding on locale only is not fine-grained
enough; setting the locale can be expensive and cause unrelated
changes.

See also GNU libc support (info "(libc) Character Set Handling"),
which applies similar principles at a lower (library) level.

All these programs chose not to expose many conversion functions
in the programming interface.  Instead, they expose few functions,
each with an encoding parameter.  That is surely a cleaner design.

thi




  reply	other threads:[~2008-06-11  7:49 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-07 23:46 [PATCH] Fix continuation problems on IA64 Neil Jerram
2008-05-08 20:09 ` Ludovic Courtès
2008-05-08 21:29   ` Neil Jerram
2008-05-09  8:15     ` Ludovic Courtès
2008-05-09 22:19       ` Neil Jerram
2008-05-11  3:06         ` Ludovic Courtès
2008-05-12 21:02           ` Neil Jerram
2008-05-14  3:45             ` Internal visibility Ludovic Courtès
2008-05-27 21:32               ` Ludovic Courtès
2008-05-31 21:23                 ` Ludovic Courtès
2008-06-01  8:00                   ` Neil Jerram
2008-06-01 11:05                     ` Ludovic Courtès
2008-06-01 20:48                       ` Neil Jerram
2008-06-01 22:02                         ` Ludovic Courtès
2008-06-01 20:24                   ` Han-Wen Nienhuys
2008-06-09 18:10                     ` Neil Jerram
2008-06-10  1:51                       ` Han-Wen Nienhuys
2008-06-10  7:37                         ` Ludovic Courtès
2008-06-10  8:04                           ` Thien-Thi Nguyen
2008-06-10 12:09                             ` Ludovic Courtès
2008-06-11  7:49                               ` Thien-Thi Nguyen [this message]
2008-06-11 12:20                                 ` Ludovic Courtès
2008-06-12 20:45                                   ` Mike Gran
2008-06-23 12:20                                     ` Ludovic Courtès
2008-06-11  4:05                           ` Han-Wen Nienhuys
2008-06-11  7:18                             ` Ludovic Courtès
2008-06-11  7:24                             ` Clinton Ebadi
2008-06-11  7:39                               ` Ludovic Courtès
2008-06-11 16:09                               ` Han-Wen Nienhuys
2008-06-23 12:18                                 ` Ludovic Courtès
2008-06-11  7:37                             ` Neil Jerram
2008-05-12 22:18     ` [PATCH] Fix continuation problems on IA64 Neil Jerram
2008-05-14  2:55       ` 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=87r6b42yyh.fsf@ambire.localdomain \
    --to=ttn@gnuvola.org \
    --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).