Catch special character errors

When `inputfile` contains bad characters, it will not attempt to print
the filename to the console.