In fact I'm being stupid, if the django is producing mixed stuff somehow then
the templating software should blow up as bytes (utf8) are added to unicode or
vice versa.
If on the other hand you declare utf16 in the rml header, but django is
producing utf8 then you'll likely get this error.
I tried just changing the encoding to utf-16 in the header of one of my test
files (ie it is a bytes file) and I get exactly this error
C:\tmp>rml2pdf bad.rml
Traceback (most recent call last):
File "c:\code\rlextra\rml2pdf\rml2pdf.py", line 6511, in <module>
main()
File "c:\code\rlextra\rml2pdf\rml2pdf.py", line 6503, in main
dynamicRml=1
File "c:\code\rlextra\rml2pdf\rml2pdf.py", line 6147, in go
parsed = parsexml(xmlInputText,eoCB=_eoDTD)
pyRXPU.error: Declared encoding UTF-16 is incompatible with UTF-8 which was used
to read it
Internal error, ParserPush failed!
clearly a bytes file cannot be utf16.
This seems to indicate you are actually producing utf8 under some circumstances.
On 09/06/2017 16:06, Robert Sullivan wrote: