上传到S3的文本文件奇怪地编码? [英] Text files uploaded to S3 are encoded strangely?

查看:170
本文介绍了上传到S3的文本文件奇怪地编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是最奇怪的错误,我甚至不知道从哪里开始了解错误。



S3一直运行良好,直到突然一天(昨天)它奇怪地编码上传到奇怪的字符的任何文本文件。每当一个文本文件有Å,Ä,Ö或任何其他UTF-8可比较但没有英文字符时,文本文件被弄乱了。我已经尝试使用各种客户端上传,以及AWS的Web界面。上传顺利,然后我下载文件,它被搞砸了。我已经尝试将其下载到我的Mac,我已经尝试将其下载到一个Raspberry与Linux上。相同的错误。



是否有Amazons S3服务器完成编码?

解决方案>

您可以在S3控制台的文件中显式设置Content-Type:text / plain; charset = utf-8。



告诉S3作为文本。


This is the strangest error, and I don't even know where to start understanding what's wrong.

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.

Is there any encoding done by Amazons S3 servers?!

解决方案

You can explicitly set the "Content-Type: text/plain; charset=utf-8", on the file in the S3 console.

This will tell S3 to serve as text.

这篇关于上传到S3的文本文件奇怪地编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆