File encoding issue when downloading file from AWS S3
问题 I have a CSV file in AWS S3 that I'm trying to open in a local temp file. This is the code: s3 = Aws::S3::Resource.new bucket = s3.bucket({bucket name}) obj = bucket.object({object key}) temp = Tempfile.new('temp.csv') obj.get(response_target: temp) It pulls the file from AWS and loads it in a new temp file called 'temp.csv'. For some files, the obj.get(..) line throws the following error: WARN: Encoding::UndefinedConversionError: "\xEF" from ASCII-8BIT to UTF-8 WARN: /Users/.rbenv/versions/2