unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* string port encodings
@ 2013-01-15 14:36 Andy Wingo
  2013-01-15 15:20 ` Alex Shinn
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Andy Wingo @ 2013-01-15 14:36 UTC (permalink / raw)
  To: guile-devel

Quiz: what does this do?

  (define (f s)
    (with-output-to-string (lambda () (display s))))

When called with a string, what should it do?  Like (f "foo").

If you answered, "return the string", that's what I would think it
should do.

But no, currently the answer is locale-specific.  It encodes the string
according to the current locale, then decodes it from that encoding.  If
your locale can't encode the string, tough luck for you!

This is a bit crazy.  Surely the port should be textual?  Surely the
default encoding for a string port should be utf-8 or something that can
actually handle all strings?

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-08-07  5:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15 14:36 string port encodings Andy Wingo
2013-01-15 15:20 ` Alex Shinn
2013-01-15 18:46 ` Mark H Weaver
2013-01-15 21:21 ` Mike Gran
2013-01-16 15:44 ` Ludovic Courtès
2013-01-16 16:57   ` Andy Wingo
2013-01-16 17:37     ` Ludovic Courtès
2013-01-16 18:16       ` Andy Wingo
2013-01-31 11:04         ` Andy Wingo
2013-01-31 17:55           ` Mark H Weaver
2013-08-07  5:37           ` Mark H Weaver

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).