#125 Fix diacritical marks problem when generating a PDF

Sorry for terrible code.