[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Transcoder library
From: |
Ludovic Courtès |
Subject: |
Re: Transcoder library |
Date: |
Wed, 01 Apr 2009 23:24:08 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) |
Hi Mike,
Mike Gran <address@hidden> writes:
> R6RS describes a transcoder library that converts locale strings to
> codepoints and back. I put together something that is like the
> library described in R6RS.
That's good news!
> Basically, one would create a transcoder like this...
>
> (define TC (make-transcoder "UTF-8"))
It's nice you already have a first stab at this API.
> ... 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?
> ... or convert to/from vectors of codepoints ...
>
> (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?
Thanks,
Ludo'.
[0] http://www.fdn.fr/~lcourtes/software/guile/guile-r6rs-libs-0.1.tar.gz
[1] http://repo.or.cz/w/guile-r6rs-libs.git
- Re: Transcoder library,
Ludovic Courtès <=