From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike Gran Newsgroups: gmane.lisp.guile.user Subject: Re: Multi-byte characters Date: Mon, 21 Jun 2010 06:20:51 -0700 (PDT) Message-ID: <115748.55918.qm@web37907.mail.mud.yahoo.com> References: <87631cr9r6.fsf@linux-lqcw.site> <87ocf44qth.fsf@linux-lqcw.site> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1277126498 24865 80.91.229.12 (21 Jun 2010 13:21:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 21 Jun 2010 13:21:38 +0000 (UTC) To: Cecil Westerhof , guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jun 21 15:21:34 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OQgwF-0001Qd-CE for guile-user@m.gmane.org; Mon, 21 Jun 2010 15:21:33 +0200 Original-Received: from localhost ([127.0.0.1]:32844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OQgw8-0008Kq-88 for guile-user@m.gmane.org; Mon, 21 Jun 2010 09:21:16 -0400 Original-Received: from [140.186.70.92] (port=42632 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OQgw0-0008HX-VL for guile-user@gnu.org; Mon, 21 Jun 2010 09:21:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OQgvn-0003YE-C5 for guile-user@gnu.org; Mon, 21 Jun 2010 09:20:56 -0400 Original-Received: from web37907.mail.mud.yahoo.com ([209.191.91.169]:46621) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OQgvn-0003Xr-78 for guile-user@gnu.org; Mon, 21 Jun 2010 09:20:55 -0400 Original-Received: (qmail 56182 invoked by uid 60001); 21 Jun 2010 13:20:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1277126452; bh=WcOAMN8bElsjB4trdNXhMIEavg1BkVofcdqKFhiJNqA=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=5+siZwQFYp+xUP/Em/MJttVPr+DZxU/4hhlqXt1z2pwoEAwB6Wy2SzeofydJEQ1U7O3TXVf4hy7YeWxXPoJpf+Mv6GRDQpEOhLlSDBeL77qnFktwEXYgurh0jmUfcyuMm+QNacqGsR9MFsWP/nAdvUtO2UMYn+afoSSXw3nnQIA= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=bdE02n+AEO+pkdwQaJPt9vEqJQ+c2Cp5zZeJ0hlku4Ad6zTjHszEYH4g6OJnxZp0GzhTX7glHGtPmfw97iox8a+dR3f3Uab8WcduATLTpQzgPOSgj8KH3AtGjQvb87IqV8L7rd+sp10ZmiPhx0uf3GYDE8koiqntWA8haAifS8c=; X-YMail-OSG: uRYWtCAVM1mf0Wgm400KJcKdNPTHQMY95K8jfCU8IqPiR5u 8_L8103tsn7WnLwAdCAA98LbOIDuUFmy8.vASb8KC8tjLjd2_GDqKOhcXto9 GgCUICfeXyFqQUrnsX7S6EqSy5mAnEb6SW.06m3s_hpf66SxGq4YQdJ548hC ggvv5eS2C3sjBkPDoYevB1zKJlpWzxZjv07DG0ZRr_MUFSAZqZZ1hPFr5bux mhHtMPQlRbB_CQ69.ebyaXLhtLzm_724SmoSODqyKPx8tSWtPx_91EQ1pBsM LBqlPTnLe4kf8ueIIHnIqRINXl5v5Yan0KW1QlplW6X8sYpd5Kl4dKNKMpxx lTP38K.UWisx3GYUTjSXSb1dCw3Qhni1IVvoO79ysEsFc Original-Received: from [71.130.214.82] by web37907.mail.mud.yahoo.com via HTTP; Mon, 21 Jun 2010 06:20:51 PDT X-Mailer: YahooMailRC/397.8 YahooMailWebService/0.8.104.274457 In-Reply-To: <87ocf44qth.fsf@linux-lqcw.site> X-detected-operating-system: by eggs.gnu.org: FreeBSD 6.x (1) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7918 Archived-At: > From: Cecil Westerhof Cecil@decebal.nl=0A=0A> I am experimenting with Gui= le. It looks like the performance is not that=0A> good. But I continue. One= of the things is multi-byte characters. I want=0A> to replace spaces with = non breaking spaces. But Guile sees a non=0A> breaking space (=A0) as two c= haracters (when using string-length). Is=0A> there a way to let Guile see i= t as one character?=0A=0AGuile 1.8.x only had native support for 8-bit char= acters, so string-length=0Ais going to return the byte length of the string= .=0A=0ARecent versions of Guile 1.9.x should have reasonable multi-byte cha= racter=0Asupport, but, to get it to work, you need to declare your locale.= =A0 UTF-8=0Aisn't necessarily assumed as default.=0A=0AYou might have to ca= ll (setlocale LC_ALL "") at the top of your program,=0Aor maybe explicitly = set your port's encoding with=0A(set-port-encoding! port "UTF-8")=0A=0A-Mik= e Gran