Skip to content

Accepting UTF-16 uiNames for form fields (qt5)

Qt5 API is not interpreting properly the encoding of form field uiName attributes (alternateUiName). It always takes them as Latin1 and that's not always the case, like in this sample PDF that had alternateUiNames in UTF16.

How to reproduce it:

Ran poppler-qt5-forms without applying the patch on the sample pdf. It will show UIName: þÿ for all UINames with any content, that is the UTF16 BOM. By applying the patch, the tool drops the proper text UIName: First name and the rest of the fields.

9c9
<                       UIName: þÿ
---
>                       UIName: First name
25c25
<                       UIName: þÿ
---
>                       UIName: Last name
57c57
<                       UIName: þÿ
---
>                       UIName: House and floor
121c121
<                       UIName: þÿ
---
>                       UIName: Use selection or write country name
138c138
<                       UIName: þÿ
---
>                       UIName: Select from list
155c155
<                       UIName: þÿ
---
>                       UIName: Value from 40 to 250 cm
171c171
<                       UIName: þÿ
---
>                       UIName: Car driving license
249c249
<                       UIName: þÿ
---
>                       UIName: Select from colour spectrum

Merge request reports