From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Massimiliano Gubinelli Newsgroups: gmane.lisp.guile.user Subject: Re: TeXmacs on Guile 2.2.4 Date: Mon, 27 May 2019 14:18:21 +0200 Message-ID: <049592E2-CAAC-4F43-98F0-FF11E91E792B@gmail.com> References: <1D2A839C-66B5-4633-91B9-1C1ACFC306E7@gmail.com> <20190526234924.GA17126@spikycactus.attlocal.net> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="237319"; mail-complaints-to="usenet@blaine.gmane.org" Cc: guile-user@gnu.org To: Mike Gran Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon May 27 14:19:05 2019 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hVEak-000zZj-U3 for guile-user@m.gmane.org; Mon, 27 May 2019 14:19:03 +0200 Original-Received: from localhost ([127.0.0.1]:45086 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVEaj-0002iT-QI for guile-user@m.gmane.org; Mon, 27 May 2019 08:19:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVEaE-0002fN-Ko for guile-user@gnu.org; Mon, 27 May 2019 08:18:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVEaA-0000kw-WC for guile-user@gnu.org; Mon, 27 May 2019 08:18:30 -0400 Original-Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:37601) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVEaA-0000eB-3T for guile-user@gnu.org; Mon, 27 May 2019 08:18:26 -0400 Original-Received: by mail-lj1-x229.google.com with SMTP id h19so6123169ljj.4 for ; Mon, 27 May 2019 05:18:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Nz8iEdHCZuEybsd9pHaLn7ualRuMefdYaRx+I6As0iI=; b=qk+0mx0+yjkR9HHgr0yV7E8avfRh3FzO+tmBu+jJf3dN3OcGLd8WygDTCxbHPXZuK3 2GPzVmPUQX0hroRiuqloxNZ5168iC/4PijxtaztsQ/Tv2jl8Ky0eQU81bldPZ24hooK1 UCDBwvJtsn6u4rbxgUNSoRahEC2zreiIIQJRVAu4h7lU73dn+2R36LRqHK7rj3S3QXDk MrltMZx97U1nIEsiXt8cYkDcc1lw+vv3NDURq2kZBMVNb9P0pb5QWQOl6M1ExtKPM/hw NdNbvJiTnZi7xfhrLZWBGhUXmlSo2INBezvO6g9XTSzcCdTpA2okhrhWWlKeJ2doT1Cp IOdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Nz8iEdHCZuEybsd9pHaLn7ualRuMefdYaRx+I6As0iI=; b=AaYafI7CJbvN66Ps78kTgiFVi6lyqJOmfIQUj3yhkUuGeb7tGFp0ZTTYf1iwWgvxgf xBL5+gExHgNm0hkJ7FkTXR4CtMKXQycTp7u7Kgj1E6ENVv4/FKX58pdTArhEsTWm8m6j ZbUfrgJ8oYXWZ0hg9Yn7Bdv97cxtI2GNz1bAQjqpDUUyDtYw1gwCrmTx0fNP5e9Iu3a0 +p341KTpCxweLcUnWOB2hUgiiy5H6/uTbOFb2Q6G3fl1XwOvPVY77n/NB2chwln4VkHV FHU3ixitfCpbty631sYMhNjfHBSFVPIreCzIsVZnH294u0H01VgLaF6MevaZPJ8nQxXs eBmQ== X-Gm-Message-State: APjAAAX9NxmWoTl4Z6WJ6C08/EFBVp0jTbBXLX/enl3LdLDB3EGwmQOD X4QPC2J8C0ZLLZiMJYRV3D4vhU1R X-Google-Smtp-Source: APXvYqz5c6aFlP+8j1JEz3U8qWAI0AImX/Upbx1XnD+2uDIpeEkruMXSX4jD+lY17fIG6lhmVjSmXQ== X-Received: by 2002:a2e:9157:: with SMTP id q23mr9879951ljg.188.1558959504309; Mon, 27 May 2019 05:18:24 -0700 (PDT) Original-Received: from [10.101.1.54] ([62.119.166.9]) by smtp.gmail.com with ESMTPSA id q124sm2224126ljq.75.2019.05.27.05.18.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2019 05:18:23 -0700 (PDT) In-Reply-To: <20190526234924.GA17126@spikycactus.attlocal.net> X-Mailer: Apple Mail (2.3445.104.8) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::229 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15501 Archived-At: > On 27. May 2019, at 01:49, Mike Gran wrote: >=20 > On Sun, May 26, 2019 at 11:17:48PM +0200, Massimiliano Gubinelli = wrote: >> Hi all, >>=20 >> I???m porting GNU TeXmacs (www.texmacs.org) to Guile 2.2.4 (and >> hopefully to Guile 3.0). The current status is the... >=20 > Hello, >=20 > Back in Guile 1.8, it was easy to use strings as ways to read and = write > binary data because Guile 1.8 always used 8-bit characters. It had no > real understanding of UTF-8. So for 1.8, the concept of strings and > bytevectors could be used more or less interchangeably. >=20 > Guile 2.2's string procedures now check that the data the receive > makes sense according to the locale. You are probably reading in a > file that isn't valid UTF-8 in a context where UTF-8 is expected, if > you locale were something like fr_FR.utf8. Or maybe you are reading > in a file that isn't pure ASCII when pure ASCII is expected, if your > locale were 'C' or 'POSIX.' >=20 > So you have two choices. You can temporarily set the locale to a > Latin-1 locale, something like 'en_US.iso88591' before you read in the > file, because, Latin-1 is an 8-bit clean locale. Or, the better idea > is to use a binary port or bytevector to read in your data. >=20 > Sorry I don't have time to be more specific. Thanks Mike, I=E2=80=99m looking right now into the problem taking into account = your remarks. While trying some alternative solutions I noticed the = following: the function scm_to_latin1_stringn calls out to = scm_to_stringn with an argument NULL for the encoding: result =3D scm_to_stringn (str, lenp, NULL, SCM_FAILED_CONVERSION_ERROR); this causes an error in scm_to_stringn since it contains the check: (c_strcasecmp (encoding, "UTF-8") =3D=3D 0) and c_strcasecmp does not check for null pointers. Is this a bug?=20 Best Max >=20 > Regards, > Mike