I'm using Dreamweaver CS3, and when I built an application I forgot to ensure that the encoding was set to UTF8.

I went through all my files and changed the encoding from western european to UTF8. This was fine until I noticed that SOME files revert back to western european encoding when re-opened.

No matter how many times I change the encoding back ( using ctrl+j and choosing the dropdown in page properties ) and save the files, it STILL reverts back to western when opened.

This only seems to happen on certain files, and some are fine. I've tried creating a new file in UTF8 and copying the contents of the old one into it. The problem persists so I'm thinking that the file may contain odd characters that are causing Dreamweaver to 'intelligently' change the encoding.

Any ideas are welcomed. Many thanks.

  • Dreamweaver 'intelligently' changes everything for you. You better off using notepad than dreamwaver! – Mike Sep 25 '09 at 9:55
  • 1
    Mike, it doesn't if used as an editor. There are reasons why I'm using this software at the moment and your suggestion, although it may well be true, does not help in this case :) – Pickledegg Sep 25 '09 at 14:50
  • That is the way it is a comment not an answer :) – Mike Sep 25 '09 at 23:38
  • my guess is that it might be related to another program opening and making changes, and losing the UTF-8 encoding in the process.. but I haven't used DW in a really really long time :) – warren Oct 3 '09 at 6:12

Files encoded as UTF-8 do not necessarily need any special marker (the so-called byte-order mark, or "BOM") to indicate they are encoded as such.

It depends on your settings whether or not Dreamweaver adds such marker. Especially for non-HTML files, it's often recommended not to add such marker for UTF-8 at all. Like a BOM in a CSS file is said to sometimes cause the initial rules in the file to fail in some browsers. And prior to version 6, PHP simply considers the BOM as output, which might yield "Cannot modify header information - headers already sent" errors.

Computer programs have a few options to determine the encoding when opening a file that has no marker: scan the first hundred bytes of the document to see what's in there, or (like for XML and HTML files) trust the value of some encoding specified as human readable text in the document. And if all fails: simply use some default when the encoding is not otherwise known.

So, there's a few things to check:

  1. Is a BOM used for the files that Dreamweaver correctly detects as UTF-8, and in the files that it detects as Western? On a Mac, open Terminal and run:

    file my-file.html

    ...which might yield something like:

    my-file.html: UTF-8 Unicode (with BOM) text, with CRLF line terminators

    On Windows, you could find the same command in Cygwin. Or use a hex-editor to see the first bytes (EF BB BF for a UTF-8 BOM). Or set a browser to explicitly use Western and do a View Source (or use an old editor that does not understand UTF-8) to see if it shows the first bytes as funny characters, such as . That's your UTF-8 BOM then.

    (If you find ÿþ or þÿ then it's UTF-16. Bad, unless you're writing something like Chinese! Not seeing any funny characters at all in this answer? Then read about using "Arial Unicode MS" at Get Dingbats to appear in Firefox 3?)

  2. Do the internals of the file specify an encoding? Such as:

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

    (In HTML files, the Content-Type should be specified before the <title> tag.)

  3. If both are present: do they match?

  4. If Dreamweaver thinks a file is not UTF-8: does it matter? So: are there any special characters in that file? A plain ASCII file does not change when it is saved as UTF-8 (unless a BOM is prefixed).

(Note that I assume you're still working with local files. If things are actually fetched from a web server, then there's also the Content-Type HTTP header. See Firefox displays garbage characters in lieu of web page then. Once you upload your files to a web server, you need to ensure the web server sends the same encoding in its Content-Type headers.)

  • Give him more than 5 minutes! I have been waiting days for a response to mine! – William Hilsum Oct 2 '09 at 23:26

I have only had to deal with a different encoding once and I had similar results to what you are saying.

I believe that it is due to the fact that Dreamweaver simply forgets / fails to detect settings on some files.

I changed this option and it worked fine for me:

alt text

Edit > Preferences > New Document... Click the checkbox "Default encoding:" / "Use when opening existing files that don't specify an encoding"


Menu Modify > Page Properties > Encoding and specify the encoding to convert the document to



None of these answers are correct.

If you want any file to open as UTF-8 when you open it, just add this line as the second or first line of your document:

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

I add this line as the second line of all of my CodeIgniter file shards... since there is no header tag in most of the files.

This tricks Dreamweaver into working properly: setting a default Encoding charset. The preferences pane does not work at all.


i think if you want to remove whe BOM from utf-8 files on dreamweaver (creating files) you should do this:

it worked for me so try and see the result by yourself

on dreamweaver:

1º go to the settings;

2º on the category menu click on "new file" or "new document"

3º the first check box has to be selected, and the default encoding need to be utf-8

1º go to the " C:\Program Files (x86)\Adobe\Adobe Dreamweaver CS6 "

2º search for Default.php and Default.dwt.php

3º open notepad++ with admin rights

4º select the two files

5º rightclick and select edit with notepad++

in notepad++:

on eatch file do this:

1º click encoding on the top bar

2º on the submenu click click: "convert to utf-8 widout BOM"

3º save file


Check out the iconv maybe...

EDIT: I don't know if you tried that iconv yet. Maybe you were too lazy to install cygwin. I found web interface to iconv in that wiki link. Check it out.

  • If present, then one also needs to change the encoding as specified in the file contents itself, like <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> – Arjan Oct 4 '09 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.