unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Cecil Westerhof <Cecil@decebal.nl>
To: guile-user@gnu.org
Subject: Re: Multi-byte characters
Date: Mon, 21 Jun 2010 16:20:03 +0200	[thread overview]
Message-ID: <87tyow31t8.fsf@linux-lqcw.site> (raw)
In-Reply-To: <115748.55918.qm@web37907.mail.mud.yahoo.com> (Mike Gran's message of "Mon, 21 Jun 2010 06:20:51 -0700 (PDT)")

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



      reply	other threads:[~2010-06-21 14:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=87tyow31t8.fsf@linux-lqcw.site \
    --to=cecil@decebal.nl \
    --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).