before printing the formatted results, encode them in ASCII with XML char replacements for chars outside the ASCII range (prevents fatal error under python 2.x when results contain unicode characters)