[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode ports patch

From: Ludovic Courtès
Subject: Re: Unicode ports patch
Date: Wed, 02 Sep 2009 10:01:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)


Mike Gran <address@hidden> writes:

>> > It would be nicer if string ports were actually bytevector ports, and that 
>> > they were locale-independent?  Or that scm_get_output_bytevector returned 
>> > a 
>> > locale-independent (ergo 8-bit or 32-bit) vector?
>> The latter.
> The test suite requires an API for testing the correctness of the encoding
> when writing or displaying a string in a given locale.  It also needs an API
> for checking that a locale-encoded byte-array can be correctly converted to a 
> string.

Hmm, OK, I understand.

> What would you suggest?

Have them return a bytevector instead of a u8vector.

My other concern was about adding it to the public API.  Do you think it
would be useful?  My initial feeling was that it may not be too useful,
hence not needing to be public, but I'm not sure.

How about adding (string->encoding STR ENCODING) => BYTEVECTOR in
`(rnrs bytevector)'[*]?  We also have `locale-encoding' in `(ice-9
i18n)', so combining the two should provide you with what you need and
may be generally useful.  Would that work for you?


[*] Eventually, `string->encoding', `uniform-array->bytevector' and
    similar extensions to R6RS should be moved in, say, `(rnrs
    bytevector gnu)', IMO.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]