Dreamweaver and Character Encoding
Thursday, April 14, 2005I ran into an interesting problem the other day. I opened a PHP file in Macromedia Dreamweaver, and only one line appeared. This was very surprising to me since it was my file and I clearly remembered writing a few hundred lines. I thought it might be corrupted, so I tried opening the version that was on the server. Same thing. This also seemed odd, since the web site on the server was working fine, something it would not do if this file was only one line long.
I opened the file in a different text editor and the whole file was there. That was a relief, but it didn’t explain what was wrong with Dreamweaver. I tried closing and reopening the file, then closing and reopening Dreamweaver, but with no success. What was interesting was I could search the file from Dreamweaver and it would find the lines that had what I was searching for, but it wouldn’t take me to those lines when I double-clicked on the results.
I searched Google and a few Dreamweaver forums, but didn’t find any mention of a problem like this. I spent a while stumbling around Dreamweaver’s menus, and just happened to find the solution: From the Modify menu, choose Page Properties. Go to the Title/Encoding category and click the Reload button. Bingo, the file appears.
My guess is that the character encoding, or Dreamweaver’s interpretation of it, became confused somewhere. I haven’t found this mentioned anywhere else, so I thought I should document it. I’m going to do some more research on character encoding and maybe do an article on it soon.