guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TeXmacs on Guile 2.2.4


From: Mike Gran
Subject: Re: TeXmacs on Guile 2.2.4
Date: Sun, 26 May 2019 16:49:24 -0700
User-agent: Mutt/1.11.3 (2019-02-01)

On Sun, May 26, 2019 at 11:17:48PM +0200, Massimiliano Gubinelli wrote:
> Hi all,
> 
>  I???m porting GNU TeXmacs (www.texmacs.org) to Guile 2.2.4 (and
>  hopefully to Guile 3.0). The current status is the
>  following. TeXmacs runs on Guile 2.2.4 with autocompilation turned
>  off: the applications opens and can read and render some
>  files. More work is necessary to switch on compilation. However
>  I???ve a problem with reading some TeXmacs files from the
>  disk. Some of them works OK, but others give errors while reading:
>  the file is first read into a C string by TeXmacs and then
>  converted into a SCM object for further manipulation by Guile. At
>  that point I receive this error message

> Things works well with Guile 1.8, so I do not understand very well what is 
> going on here. Somebody  has some clue as to what could cause this problem?

Hello,

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.

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.'

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.

Sorry I don't have time to be more specific.

Regards,
Mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]