guile-devel
[Top][All Lists]
Advanced

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

Re: Reading data from a file descriptor


From: tomas
Subject: Re: Reading data from a file descriptor
Date: Tue, 17 Nov 2015 13:52:21 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Nov 17, 2015 at 12:59:56PM +0000, Chris Vine wrote:
> On Tue, 17 Nov 2015 10:53:19 +0100

[...]

> guile's R6RS implementation has get-bytevector-some, which will do that
> for you, with unix-read-like behaviour.

Thank you a thousand. You made me happy :-)

> You cannot use this for UTF-8 text by trying to convert the bytevector
> with utf8->string, because you could have received a partially formed
> utf-8 character.

I understand that. If you want to do that you need an incremental
converter, like the one provided by iconv(3).

>                  So for text, you should use line orientated reading,
> such as with ice-9 read-line or R6RS get-line.

Not necessarily, see above. Perhaps just sub-streams of your input are
UTF-8, or whatever; but yes, the parsing responsibility is then with
the user, by whatever means.

Thank you again. I was looking for that function all in the wrong
places :-/

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlZLIwUACgkQBcgs9XrR2kZ8IQCfUDejBFEWgnDcZrEESv0pT0uT
JnkAnRdDUpD2uwIlObNlTRXChENtdZHB
=s1WT
-----END PGP SIGNATURE-----



reply via email to

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