Ignore non-UTF-8 chars when checking for program directive in makePDF