You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Impacted versions: odoo 15 on ubuntu 20.04 with wkhtmltopdf 0.12.6 (with patched qt)
Steps to reproduce: Create a PDF using qweb report which has umlauts or some other non-ASCII characters.
Current behavior: The umlauts are not correctly displayed in the PDF.
problem: PDFs created using qweb reports don't display umlauts (or non-ASCII utf-8 characters) correctly.
the underlying issue: the PDFs are created by running wkhtmltopdf on some temporary html files.
in odoo 14, the umlaut 'ü' was encoded in the temporary body html as ' & # 252 ; ' (spaces inserted in order to display it on github).
in odoo 15, the umlaut 'ü' is used as it is.
there are two possible solutions:
(A) One can explicitly specify the encoding as argument to wkhtmltopdf. add
command_args.extend(['--encoding', 'utf-8'])
to _build_wkhtmltopdf_args(...) in ir_actions_report.py
(B) One can force lxml to output '& # 252 ;' . To this end, use
'body': Markup(lxml.html.tostring(node, encoding='ASCII')).decode('utf-8'),
and
body = ''.join(lxml.html.tostring(c, encoding='ASCII').decode('utf-8') for c in body_parent.getchildren())
in _prepare_html(...) in ir_actions_report.py
Could you please adopt one of the two solutions ?
The text was updated successfully, but these errors were encountered:
Impacted versions: odoo 15 on ubuntu 20.04 with wkhtmltopdf 0.12.6 (with patched qt)
Steps to reproduce: Create a PDF using qweb report which has umlauts or some other non-ASCII characters.
Current behavior: The umlauts are not correctly displayed in the PDF.
problem: PDFs created using qweb reports don't display umlauts (or non-ASCII utf-8 characters) correctly.
the underlying issue: the PDFs are created by running wkhtmltopdf on some temporary html files.
in odoo 14, the umlaut 'ü' was encoded in the temporary body html as ' & # 252 ; ' (spaces inserted in order to display it on github).
in odoo 15, the umlaut 'ü' is used as it is.
there are two possible solutions:
(A) One can explicitly specify the encoding as argument to wkhtmltopdf. add
command_args.extend(['--encoding', 'utf-8'])
to _build_wkhtmltopdf_args(...) in ir_actions_report.py
(B) One can force lxml to output '& # 252 ;' . To this end, use
'body': Markup(lxml.html.tostring(node, encoding='ASCII')).decode('utf-8'),
and
body = ''.join(lxml.html.tostring(c, encoding='ASCII').decode('utf-8') for c in body_parent.getchildren())
in _prepare_html(...) in ir_actions_report.py
Could you please adopt one of the two solutions ?
The text was updated successfully, but these errors were encountered: