Files saved in utf-8 shown broken in browsers

0

0

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.

antpaw

Posted 2013-11-07T10:30:45.170

Reputation: 234

Does the same thing happen if you check "Add byte order mark"? – James P – 2013-11-07T10:59:57.257

Wow, you are right! It works with this "byte order mark" option.

But some editors that I use doesn't have this option (textmate1) what to do there? I guess this can't be fixed since Mavericks changed the way text files are opeend. – antpaw – 2013-11-07T14:03:36.857

What editors are you using? Some of them may have options for this hidden away somewhere in the settings window rather than the save dialog. It does sound like it might be a bug in Mavericks or something wrong on your system though. – James P – 2013-11-07T14:14:48.757

Answers

0

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

gileri

Posted 2013-11-07T10:30:45.170

Reputation: 199

this is not a html page, i need this for my json, js ect files. and it worked before mavericks – antpaw – 2013-11-07T10:39:21.080

1It's the only way to tell the web browser the encoding of the "webpage". You can also do it manually in Chrome by clicking on Menu > Tools > Encoding and setting the encoding you would like to use. – gileri – 2013-11-07T10:46:57.730

You are right, if i select "Auto Detect" Encoding in the menu it shows the file the right why, but utf-8 was selected anyway before and "ß" is a utf-8 letter. I don't understand it. And it fixes the problem just for me, not for the others who read this .txt – antpaw – 2013-11-07T10:51:46.713