Bug Report: pdfLaTex does not accept utf-8 checkmark character as command but claims Invalid UTF-8 byte "9C"

Dirk Herrmann dirk.herrmann-privat at gmx.de
Sat Jan 20 00:53:24 CET 2024


Dear maintainers,

I would like to report a (likely) bug with pdfTeX
3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian).

I have the following command definition:

     \newcommand{\✓}{\checkmark}

This has worked flawlessly with XeLaTeX so far.  As I now realized that
pdfLaTeX by default uses UTF-8 as input format since 2018, I am giving
this a try (pdfTeX 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian)). 
For that command, however, I get the following error message:

     ! LaTeX Error: Invalid UTF-8 byte "9C.

(Yes, the quote after "9c is missing in the output).

To be sure that this is not actually a badly encoded file (unlikely as
XeLaTeX has accepted it and Emacs shows it properly), I created a hexdump:

     00004ab0  77 63 6f 6d 6d 61 6e 64  7b 5c e2 9c 93 7d 7b 5c
|wcommand{\...}{\|

The checkmark sequence is 'e2 9c 93' as I understand it to be correct,
according to https://www.compart.com/en/unicode/U+2713.

Is this a bug in pdfLaTeX, or is it not intended to create such commands
containing UTF-8 characters with pdfLaTeX anyway?

Thanks a lot for all your work on the various TeX components, and kind
regards,
Dirk Herrmann



More information about the tex-live mailing list.