AWS S3是否会破坏某些unicode字符

时间:2022-09-06 20:16:44

I'm trying to upload a text file that has the following line:

我正在尝试上传包含以下行的文本文件:

var ε = 1e-6, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;

When I point my web browser at the file in the bucket, it displays like this:

当我将Web浏览器指向存储桶中的文件时,它显示如下:

  var ε = 1e-6, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;

When I download the file using wget and open it up, it looks fine.

当我使用wget下载文件并将其打开时,它看起来很好。

Why isn't the browser interpreting the unicode correctly? Do I need to adjust the content-type or something?

为什么浏览器没有正确解释unicode?我是否需要调整内容类型或其他内容?

1 个解决方案

#1


1  

As SLaks and Mark Ransom suggested, setting the content-type header to include charset=utf-8 fixed the issue.

正如SLaks和Mark Ransom建议的那样,将内容类型标题设置为包含charset = utf-8可以解决问题。

#1


1  

As SLaks and Mark Ransom suggested, setting the content-type header to include charset=utf-8 fixed the issue.

正如SLaks和Mark Ransom建议的那样,将内容类型标题设置为包含charset = utf-8可以解决问题。