[Top][All Lists]

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

Re: Multi-byte characters

From: Mike Gran
Subject: Re: Multi-byte characters
Date: Mon, 21 Jun 2010 06:20:51 -0700 (PDT)

> From: Cecil Westerhof address@hidden

> I am experimenting with Guile. It looks like the performance is not that
> good. But I continue. One of the things is multi-byte characters. I want
> to replace spaces with non breaking spaces. But Guile sees a non
> breaking space ( ) as two characters (when using string-length). Is
> there a way to let Guile see it as one character?

Guile 1.8.x only had native support for 8-bit characters, so string-length
is going to return the byte length of the string.

Recent versions of Guile 1.9.x should have reasonable multi-byte character
support, but, to get it to work, you need to declare your locale.  UTF-8
isn't necessarily assumed as default.

You might have to call (setlocale LC_ALL "") at the top of your program,
or maybe explicitly set your port's encoding with
(set-port-encoding! port "UTF-8")

-Mike Gran

reply via email to

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