In Python 2, convert literal strings explicitly to ASCII when possible

Fix for #304