0

I am downloading a CSV file, which Safari (annoyingly) puts directly onto the page. This CSV file is encoded with UTF-8, and has been verified to be correctly encoded with UTF-8 from the source file, as well as downloading it using other browsers.

However, in Safari the character set is incorrect. It is using a Default character set, as seen by looking in the menu:

View > Text Encoding > Default

If I change this to:

View > Text Encoding > Unicode (UTF-8)

I get the correct characters displayed.

Why is UTF-8 not the default? How can I force it to be the default?

Isn't UTF-8 the default for the whole MacOS operating system, so I have no idea why Safari would be using something different.

1
  • How does the website say that the encoding is UTF-8. The default here is not the OS city is the default of http etc
    – mmmmmm
    Commented Apr 24 at 19:58

1 Answer 1

0

Digging into the Safari settings, I discovered that the Default Encoding was Western (ISO Latin 1)

Settings... > Advanced tab > Default encoding

Changing this to Unicode (UTF-8) now correctly uses UTS-8 characters in my CSV download and they are no longer garbled.

This makes it work for me, so I'm putting this as an answer, but I still don't understand why such an unreasonable default as Western (ISO Latin 1) is the default for Safari encoding.

I also don't yet know if this will impact the usage of Safari on other websites that have multilingual characters.

3
  • Because that has been the default web encoding since before UTF-8 existed and I suspect when Safari was first written this was still the usual encoding of pages. Changing a default would break many things.
    – mmmmmm
    Commented Apr 3 at 12:39
  • Yes, but they changed the default character set for the operating system to UTF-8 (or UTF-16) ages ago. I don't think there is a valid reason to continue using a default like Western (ISO Latin 1) in the browser any more. It causes very subtle bugs and garbled characters people struggle with. I'm tired of hitting these character set bugs. Nothing I can do about it though, other than manually setting it to something more reasonable in my system.
    – Jim Leask
    Commented Apr 24 at 15:53
  • @JimLesik The point here is not what the OS uses it is what most webpages are encoded in. Also what is sent in the http message and HTML headers, often they are wrong and if not there what do you use. pre 1997 it was plain Ascii and then a Windows encoding (as MS IE was the overwhelming engine)
    – mmmmmm
    Commented Apr 24 at 19:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .