Op maandag 21 jun 2010 15:20 CEST schreef Mike Gran: >> From: Cecil Westerhof ce...@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