py: ensure that encoding is set
callback: debug info added
latex_log.py: use unicode internally