if encoding fails, default to ascii