# Unicode in PDF metadata with latex3 and an utf8 engine

TeX - LaTeX Asked by Callegar on October 26, 2020

In Unicode in PDF Metadata, Heiko Oberdiek proposes a way to set the PDF metadata to some unicode string while operating at the low level, without resorting to hyperref. To this aim, he ends up using the stringenc package to do the necessary re-encoding of the string from utf-8 to utf-16be and he needs to manually add a BOM. Here is his example:

% UTF-8 encoded source file
input stringenc.styrelax

defMyAuthor{Erwin Schrödinger}
edefBOM{string376string377}
StringEncodingConvert{PdfAuthor}{MyAuthor}{utf8}{utf16be}
StringEncodingSuccessFailure{}{%
errmessage{Conversion from utf8 to utf16be failed for author string}%
}
pdfinfo{/Author(BOMpdfescapestring{PdfAuthor})}%
null
bye


I wonder if there is a way to do the same without having to resort to stringenc, but relying on the latex3 interfaces. I have seen that there is a whole latex3 package for string encoding conversions, that is l3str-convertpackage. However, I cannot find anything strightforwardly doing what I need. For instance, is there a pre-made BOM definition for PDF metadata? Should I rely on str_set_convert:Nnnn to do the conversion (possibly with a :NVnn variant?). Is there an all-in one function doing the conversion for me? str_convert_pdfname:n is certainly not what I am looking for, right?

## Related Questions

### AUCTeX can’t find file when there is an umlaut in its name (on Mac OS X)

1  Asked on April 28, 2021 by user2249626

### How to place a framed full-width text box on the bottom of the last page in two column documents?

2  Asked on April 28, 2021 by rriemann

### Add table borders around notes created with package ‘threeparttablex’

1  Asked on April 28, 2021

### Drawing triangles in latex

1  Asked on April 28, 2021

### How to outline the union of an annulus and a rectangle in TikZ?

1  Asked on April 28, 2021

### Conditional header’s content depending on xsim solutions being printed or not

1  Asked on April 28, 2021

### Beamer/Latex, is there a way to put a theorem in an “itemize”, and hide the bullet?

1  Asked on April 28, 2021 by surb

### Solidity listing: IEEE Conference Template

0  Asked on April 28, 2021

### How to typeset listof (revisited)

1  Asked on April 28, 2021

### Change the location of graphic TOC in achemso template

0  Asked on April 28, 2021 by zjr

### How can we use tikz package to draw a rectangle and fill it with a color for the equations?

2  Asked on April 28, 2021

### Horizontal alignment in an item in itemize

5  Asked on April 28, 2021

### Esperanto flag in Tikz?

2  Asked on April 28, 2021 by amelie-b-blackstone

### Remove newlines between Authors, title and journal in bibliography using natbib

1  Asked on April 28, 2021 by steeven-villa

### What is the proper use of @ (i.e., backslash-at)?

4  Asked on April 28, 2021 by ben-lerner

### Indexing of single and multiple Psalms in bibleref / bibleref-german

1  Asked on April 28, 2021 by greektex

### Getting xetex to complain when a character is missing

1  Asked on April 28, 2021

### Enumerated list indentation

2  Asked on April 28, 2021

### Hyphenation for words with underscore

3  Asked on April 28, 2021 by towi

### Multi-line URLs are not properly colored in floating captions

1  Asked on April 28, 2021