Hi! Mike Gran <spk...@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.