\char is not an expandable command, thus it does not work as string in
\char would use the current font encoding. But the font encoding is irrelevant here. Instead, the PDF specification allows two encodings:
- PDFDocEncoding, an 8-bit encoding, different, but similar to latin1,
- UTF16-BE with BOM for Unicode strings
stringenc helps in converting a string (e.g. from UTF-8) to the correct encoding, needed for the values in
Also the values for the keys in
\pdfinfo must be escaped as strings, for example unmatched parentheses; pdfTeX's
\pdfescapestring helps here for strings given in parentheses.
The other string form are angle brackets with the string encoded as hexadecimal string.
\pdfstringdef takes care of lots of these issues. It also defines virtual font encodings
PU to get many characters work. For reinventing the wheel I strongly recommend reading the section about strings in the PDF specification.
At TeX level, the string needs to expand as plain text string without commands. PDF viewers do not know about TeX commands inside bookmark strings.
The letters by
a) can be given as (PDFDocEncoding):
pdfinfo reports then: