Subject: [clisp-list] Re: new-clx builds bad encoding name

From: Bruno Haible <[email-masked]>
Date: Fri Dec 19 13:11:02 2003

Pascal Bourgignon écrivait:
> The   error  seems   to  be   coming  via   XLIB:MAX-CHAR-ASCENT  from
> clisp/modules/clx/new-clx/clx.f line  1056 to  1081. It looks  like it
> builds   the   encoding   name   from   the   registry   of   some   X
> font.  Unfortunately, that  registry  is "iso8859"  while the  CHARSET
> package exports ISO-8859-1 et al.

Yes, unfortunately different standards and softwares use different sets
of encoding names. You have to convert. Since here the input is an X11
encoding name and the result should be an encoding name suitable for
CLISP :CHARSET, the conversion should go the whole way and also convert
insert a dash between "iso" and "8859".

Sam wrote:

> [6]> (make-encoding :charset "iso8859-1")
> #<ENCODING "iso8859-1" :UNIX>

This depends on the underlying iconv() version. In libiconv 1.9.1 the
name "iso8859-1" happens to be supported; in earlier versions it is not.

> should MAKE-ENCODING automatically convert "iso8859-1" to CHARSET:ISO-8859-1?
> Should CHARSET contain ISO8859-1 as a synonym for ISO-8859-1?

No for both. 1. The list of supported encodings in clisp is documented; if
people call MAKE-ENCODING with names not adhering to this documentation, it's
by lazy code. 2. The strategy of adding aliases leads to addition of all
possible names in all possible software APIs. After we've added ISO8859-1
as alias of ISO-8859-1, someone will stand up and claim to need CP65001 as
an alias for UTF-8, etc. etc. - it's a never ending hassle. Better is to keep
things where they belong, and the handling of X11 encoding names belong in
X11 interface code and not in the clisp CHARSET package.

Bruno