Fixed encoding try/except