Return infinite error for non printable characters

This is the same behavior used by the python version.