guile-user
[Top][All Lists]
Advanced

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

Re: UTF-8 and new ports


From: Ludovic Courtès
Subject: Re: UTF-8 and new ports
Date: Fri, 15 Feb 2008 09:36:24 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Hi,

Mike Gran <address@hidden> writes:

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

Indeed, the C port API in inherently 8-bit.

I don't know if it helps, but Guile-R6RS-Libs[*] provides limited UTF
handling:

  guile> (use-modules (r6rs bytevector) (r6rs io ports))
  guile> (define bv (get-bytevector-all (open-input-string "hello world")))
  guile> (utf8->string bv)
  "hello world"

It assumes that Guile strings are encoded in the current locale's 8-bit
charset, though...

Thanks,
Ludovic.

[*] http://repo.or.cz/w/guile-r6rs-libs.git





reply via email to

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