unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: Unicode ports patch
Date: Wed, 02 Sep 2009 10:01:27 +0200	[thread overview]
Message-ID: <87eiqpepwo.fsf@gnu.org> (raw)
In-Reply-To: 766146.93830.qm@web37904.mail.mud.yahoo.com

Hi!

Mike Gran <spk121@yahoo.com> 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?

Thanks,
Ludo'.

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





      reply	other threads:[~2009-09-02  8:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-25 15:06 Unicode ports patch Mike Gran
2009-08-25 19:54 ` dsmich
2009-08-25 19:58 ` Andy Wingo
2009-09-01  8:19 ` Ludovic Courtès
2009-09-01 18:25   ` Andy Wingo
2009-09-01 19:19     ` Mike Gran
2009-09-01 19:34       ` Ludovic Courtès
2009-09-01 21:08         ` Mike Gran
2009-09-02  8:01           ` Ludovic Courtès [this message]

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=87eiqpepwo.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@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).