From: Mike Gran <spk121@yahoo.com>
To: Guile User <guile-user@gnu.org>
Subject: UTF-8 and new ports
Date: Thu, 14 Feb 2008 13:40:35 -0800 (PST) [thread overview]
Message-ID: <940333.54559.qm@web37904.mail.mud.yahoo.com> (raw)
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
next reply other threads:[~2008-02-14 21:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-14 21:40 Mike Gran [this message]
2008-02-15 2:39 ` UTF-8 and new ports Stephen Compall
2008-02-15 8:36 ` Ludovic Courtès
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=940333.54559.qm@web37904.mail.mud.yahoo.com \
--to=spk121@yahoo.com \
--cc=guile-user@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).