Wednesday, February 24, 2010

Mac to PC, PC to Mac

I'm concurrently taking CTVA 361 and ART 201. We're pretty much learning the same things at the same time. In both classes, we learned HTML and then followed by Dreamweaver. I have a PC at home where as in ART 201 we use a Mac. The problem I'm most worried about is working on our assignment in class and editing at home or vice versa. I had a classmate in CTVA 361 who uses a PC at school but a Mac at home. When she created her website using TextEdit, she opened it up on the PC and her HTML were all in one line. All of her breaks she had in her TextEdit was ignored on a PC, making it difficult to organize any of the tags. Is there a way we could save the file on one computer without changing any of the content when opened in another computer? Or is there a way we can open the file up without changing it?

-Amy Truong

2 comments:

Web Design at CSUN said...

Since Mac OS and Windows uses different text encoding protocols (UTF-8 and ISO 8599-1, respectively), the line breaks are behaving differently. There are two different solution to this problem.
* When saving the file for the first time, specify the format to ISO 8599-1 (that option doesn't exist in TextEdit, but I'm confident that the "Windows Latin 1"-format works fine).
* When opening the file, specify the encoding in the dialogue window. If you choose UTF-8 and notice that there are not line breaks, reopen it again, but choosing ISO 8599-1 this time.

The explanation why the line breaks are removed, but no other characters, is that the different formats use a different numbers of symbols for representing a line break. If you open the document in a program that actually prints the symbols, instead the line breaks, it would look like this on a Windows machine: "Line1\r\nLine2\r\n [...]". A document encoded for Mac, however, only requires the "\n"-symbol for identifying a line break. Read more here: http://en.wikipedia.org/wiki/Newline

I hope this works out for you. Otherwise, let me know in class next time and I can help you out.

-- Erik Hedberg

Web Design at CSUN said...

Eric, thank you. This is very helpful and I'll make sure Amy sees your post.