[Dev-luatex] \Uchar errors with "FFFD

Hans Hagen j.hagen at xs4all.nl
Sat Aug 13 08:14:41 CEST 2022


On 8/12/2022 8:08 PM, Ulrike Fischer wrote:
> \Uchar"FFFD
> \bye
> 
> 
> errors with
> 
> ! String contains an invalid utf-8 sequence.
> l.93 \Uchar"FFFD
> 
> 
> (^^^^fffd  works)
In luatex we have this in the string converter

     if (val == 0xFFFD)
         utf_error();

because 0xFFFD is the intial value.

In luametatex I just return 0xFFFD on an invalid utf but if we want to 
be compatible in luatex we need to issue that message on an invalid 
characters so we can start out with initial -1 and change it to

     if (val < 0)
         utf_error();

that way FFFD will fall through

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the dev-luatex mailing list