I create my web pages in Dreamweaver on an Intel Mac. Pull the files to my PC for viewing in IE 7. Any minor adjustments I make using Notepad, save and put back on the Mac. I view the Notepad files fine on the PC and Dreamweaver opens them without a problem - been doing this over a year.
Now I have a client who works on the pages making a small adjustment to the quantity of a product - page is fine (online and View Source through IE is correct), but when I download and view on Notepad I have scrambled characters - am assuming are carriage returns.
At first I thought it was the client using something different to open. Then I tested my own pages and found the same to be true.
While I CAN correct this by opening in Word, Save As and then return to Notepad - I would like to gain some understanding of "why".
Does it have to do with Dreamweaver setting the "charset=UTF-8" (see below). If so, is this what I want, or should I change this preference? It views fine in IE on PCS and on Macs through Safari and Firefox. Thanks.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
I forgot to clarify: I get the screwy notepad when I download my own pages via ftp , otherwise they are fine on my hard drive. NOT after I download them.
One possible solution
When saving files, set the Encoding to UTF-8 rather than ANSI
ANSI, Unicode, UTF-8, and the path of most resistance!
Advanced Unicode Questions
If the lines are all run together (no line breaks) and there are little squares where the linebreaks should be, it probably is due to different line end characters. This isn't due to differences in the charset encoding of the HTML file, but to differences in how different operating systems save linebreaks in text files.
Notepad and Windows use CRLF. I think Linux uses just LF, and I think Mac uses just CR (though I'm less sure of that one).
Word sometimes takes liberties with files being saved, especially HTML, so I wouldn't trust it with that task.
However, you can accomplish the same thing by opening the file in WordPad and saving it. WordPad is less likely to do other weird things to the file.
[edited by: SteveWh at 2:41 am (utc) on Feb. 25, 2009]
This makes sense to me as it appears to be what is happening. Once I open in Wordpad (I know not to use Word) and save as a text file html extension It appears normal in Notepad.
All that said would I be better off using BBedit or some other text editor in Windows other than Notepad? Since the code is coming from Dreamweaver will I always have an issue between the two operating systems?
Also take a look at your ftp clients: they should be able to translate text files like css and html to have the right CR/LF combo on the other side if the transfer is done in ASCII mode vs. BINARY.
Obviously you do not want that ASCII mode for a gif, joeg or png, but you might want it for html.
There's nothing inherently wrong with Notepad or Wordpad, but for editing code you probably want something with syntax highlighting, like Notepad++ or Textpad.
Some background on line termination can be found at [blogs.msdn.com...] .
Many HTML editors have the option to save files with the various line-enders used by Windows and *nix (including Macs). When saving as text files, MS Word also has (or had -- I'm not sure about the most recent versions) the capability to use various line-enders.
Download Notepad++ it's a fantastic little editor designed for programmers, it also automatically handels the unix end of line character which I suspect what your problem is.
Remember to select the current programming language you are using under the menu entry "Language"
It is still odd:
I create in Dreamweaver UTF-8 charset - pull to PC, view the file in IE7, view the Notepad code - NO change to code, upload, then download and view the code. (Upload ASCII and download same)
I now see all the screwy carriage returns, again. I have used 2 different ftp programs with the same results.
At this point, just hoping to know the "why".
ASCII transfer mode requires the server and client both know what their proper line endings are, and if either one is wrong, hoo-boy! That said, most any editor other than Notepad can handle the various types of line endings without difficulty, so if ASCII transfer mode is causing problems, why not use BINARY for everything?
I use Free product from Microsoft :-V isual Web Developer, works good, can view online files, edit them, all fine.