mac - Files saved in utf-8 shown broken in browsers

07
2014-07
  • antpaw

    Now every time I save a file with utf-8 (default, like I did it the last 8 years) my browsers (Chrome, Firefox) can't read it properly any longer. If I use encoding utf-16 it works fine, but I don't want to use utf-16.

    I think it's OSX Mavericks problem, not a editor or browser issue because it happens with every editor and browser since I have mavericks installed.

    enter image description here

    Same result if I upload it to a ftp server where I never had encoding issues.

  • Answers
  • Eric Gillet

    You need to specify the encoding of the html page by inserting either :

    • <meta charset="utf-8"> or
    • <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    Source : Wikipedia


  • Related Question

    osx - Problem with unpacking zip archive with UTF-8 file names in OS X if zip was made in Windows
  • Andrei

    I have packed my files in Windows 7 using Total Commander asking to use UTF-8 for file names. Then I tried to unpack my files in OS X, but Cyrillic names were messed. I have tried most programs -- none has helped me, so I had to use Parallels with Windows and Total Commander to get what I want.

    Is there any other way to do it? Is it a fault of Total Commander or I need to tune OS X settings?


  • Related Answers
  • Ignacio Vazquez-Abrams

    Assuming your decompress tool passes the raw filenames directly to the VFS layer, it's not enough for the filenames to be in UTF-8. They must also be in Normal Form D. Having the filenames in Normal Form C will end up having them mangled in the VFS layer.