* Multi-byte characters
@ 2010-06-21 9:54 Cecil Westerhof
2010-06-21 10:33 ` Cecil Westerhof
0 siblings, 1 reply; 4+ messages in thread
From: Cecil Westerhof @ 2010-06-21 9:54 UTC (permalink / raw)
To: guile-user
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?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Multi-byte characters
2010-06-21 9:54 Multi-byte characters Cecil Westerhof
@ 2010-06-21 10:33 ` Cecil Westerhof
2010-06-21 13:20 ` Mike Gran
0 siblings, 1 reply; 4+ messages in thread
From: Cecil Westerhof @ 2010-06-21 10:33 UTC (permalink / raw)
To: guile-user
Op maandag 21 jun 2010 11:54 CEST schreef Cecil Westerhof:
> 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?
Properly the character is not visible in all e-mail clients. When
putting the non break space in a file and putting this file through:
od -c
you get:
0000000 302 240 \n
0000003
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Multi-byte characters
2010-06-21 10:33 ` Cecil Westerhof
@ 2010-06-21 13:20 ` Mike Gran
2010-06-21 14:20 ` Cecil Westerhof
0 siblings, 1 reply; 4+ messages in thread
From: Mike Gran @ 2010-06-21 13:20 UTC (permalink / raw)
To: Cecil Westerhof, guile-user
> From: Cecil Westerhof Cecil@decebal.nl
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Multi-byte characters
2010-06-21 13:20 ` Mike Gran
@ 2010-06-21 14:20 ` Cecil Westerhof
0 siblings, 0 replies; 4+ messages in thread
From: Cecil Westerhof @ 2010-06-21 14:20 UTC (permalink / raw)
To: guile-user
Op maandag 21 jun 2010 15:20 CEST schreef Mike Gran:
>> From: Cecil Westerhof Cecil@decebal.nl
>
>> 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")
As I understand it Guile 2.0 should be released in the near future, I
wait for that version then. At the moment I am just playing with it, so
it is not that important (at the moment).
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-06-21 14:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-21 9:54 Multi-byte characters Cecil Westerhof
2010-06-21 10:33 ` Cecil Westerhof
2010-06-21 13:20 ` Mike Gran
2010-06-21 14:20 ` Cecil Westerhof
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).