unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Mike Gran <spk121@yahoo.com>
To: guile-user@gnu.org
Subject: Re: Transcoder library
Date: Wed, 01 Apr 2009 22:46:21 -0700	[thread overview]
Message-ID: <1238651181.2715.169.camel@localhost.localdomain> (raw)
In-Reply-To: <87tz58dq4n.fsf@gnu.org>

On Wed, 2009-04-01 at 23:24 +0200, Ludovic Courtès wrote:
> Hi Mike,
> 
> Mike Gran <spk121@yahoo.com> writes:

> > Basically, one would create a transcoder like this...
> >
> > (define TC (make-transcoder "UTF-8"))
> > ... and then use it either to read codepoints from encoded files ...
> >
> > (read-codepoint PORT TC)
> > (write-codepoint CODEPOINT PORT TC)
> 
> That would be roughly equivalent to the procedures in R6RS Section
> 8.2.9, right?
> 

That was the intention.  R6RS has the transcoder as a property of the
port, so I wrote port and transcoder side-by-side to imply that
association.  

> > (locale-string->u32vector STRING TC)
> > (u32vector->locale-string U32VECTOR TC)
> 
> FWIW, I implemented the `string->utf*' and `utf*->string' procedures
in
> Guile-R6RS-Libs [0,1] using the relevant Gnulib modules.  I'm planning
> to integrate it in Guile `master' at some point; would that be helpful
> to you to put it all together?
> 

Funny.  I did actually look through Guile-R6RS before putting this
together, but, somehow I overlooked that.  Yours has the feature of
dealing with various sizes of int.  Nice.  Mine has some of the ugly
code required to deal with the conversion of line endings that R6RS
requests.

With respect to the greater goal of wide strings in Guile, I have
played with it quite a bit, though I haven't posted much code. Now, I
am convinced that the character encoding should be a property of the
port.  It would be helpful, then, to have R6RS ports integrated at some
point.

Thanks,

Mike Gran






  reply	other threads:[~2009-04-02  5:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-30  3:02 Transcoder library Mike Gran
2009-04-01 21:24 ` Ludovic Courtès
2009-04-02  5:46   ` Mike Gran [this message]
2009-04-04 23:15     ` Ludovic Courtès
2009-04-08  7:33     ` 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=1238651181.2715.169.camel@localhost.localdomain \
    --to=spk121@yahoo.com \
    --cc=guile-user@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).