上传到 S3 的文本文件编码很奇怪? [英] Text files uploaded to S3 are encoded strangely?
问题描述
这是最奇怪的错误,我什至不知道从哪里开始理解错误.
This is the strangest error, and I don't even know where to start understanding what's wrong.
S3 一直运行良好,直到突然有一天(昨天)它奇怪地将上传的任何文本文件编码为奇怪的字符.每当文本文件有 Å、Ä、Ö 或任何其他 UTF-8 可比较但没有英文字符时,文本文件就会混乱.我尝试使用各种客户端以及 AWS 的 Web 界面上传.上传很顺利,然后我下载了文件,结果一团糟.我试过将它下载到我的 Mac,我试过将它下载到装有 Linux 的 Raspberry.同样的错误.
S3 has been working well, up until suddenly one day (yesterday) it strangely encodes any text file uploaded to strange characters. Whenever a text file has Å, Ä, Ö or any other UTF-8 comparable but none English characters, the text file is messed up. I've tried uploading using various clients, as well as the web interface of AWS. The upload goes well, then I download the file and it's messed up. I've tried downloading it to my Mac, I've tried downloading it onto a Raspberry with Linux on it. Same error.
亚马逊的 S3 服务器有没有编码?!
Is there any encoding done by Amazons S3 servers?!
推荐答案
我遇到了同样的问题,我通过在 properties -> metadata 中添加 charset=utf-8
解决了它文件的强>
I had the same problem and I solved it by adding charset=utf-8
in properties -> metadata of the file
这篇关于上传到 S3 的文本文件编码很奇怪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!