Problems with some Unicode characters
See original GitHub issueHi, I’m using the latest xhtml2pdf (0.2b1) & reportlab (3.4.0) through django-easy-pdf (0.1.0) on Python 3.6.0 and it’s working great for the most part! One problem I am still experiencing, though, is that some Unicode characters are not rendering properly (šŠčČćĆđĐžŽ):
I’m using the default django-easy-pdf base template and I found that I can somewhat repair things if I override it to declare the html encoding:
{% block extra_style %}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
{% endblock %}
Which results in some characters being rendered correctly like Š and Ž, but not all of them (Č, Ć, Đ are still blacked out).
I tried experimenting with different font declarations (sans-serif, serif, external fonts), but I can’t seem to fix this. The characters are never rendered correctly. I don’t know if I’m missing some xhtml2pdf / Reportlab setting here. Do you maybe have an idea of a possible solution?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:48 (15 by maintainers)
Top GitHub Comments
Any news on fixing the bug? I tried all of the solutions I found on the web and none work, I still get nasty boxes instead of non-latin characters.
In my case helps
<style> @font-face { font-family: Roboto; src: "C://Users//user//Desktop//Project//static//fonts//Roboto-Regular.ttf"; } body { font-family: "Roboto", sans-serif; </style>