unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* UTF-8 and new ports
@ 2008-02-14 21:40 Mike Gran
  2008-02-15  2:39 ` Stephen Compall
  2008-02-15  8:36 ` Ludovic Courtès
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Gran @ 2008-02-14 21:40 UTC (permalink / raw)
  To: Guile User

Hi-

Suppose I'm creating a new Guile port type that is
going to use NCurses primitives for input (scm_getc)
and output (display).  NCurses can both receive input
and display output of wide characters, but, these
functions operate on 32-bit wide unicode codepoints,
aka UTF32.

It seems that port types are inherently 8-bit, right? 
So to make this work, the ports will have to store and
transmit characters as UTF-8 encoded data.  The
'fill_input' function will have to convert UTF-32 to
UTF-8 and then cache them, passing them 1 byte at a
time as requested.  The 'write' function will receive
data 1 byte at a time and buffer it.  It will only
write the character when a complete UTF-32 codepoint
has been received.

Sound right?

Has anyone already done this sort of thing?

--
Mike Gran




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

end of thread, other threads:[~2008-02-15  8:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-14 21:40 UTF-8 and new ports Mike Gran
2008-02-15  2:39 ` Stephen Compall
2008-02-15  8:36 ` Ludovic Courtès

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