Best encoding and fileformat to use for web design ?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
Rippie
Forum Commoner
Posts: 76
Joined: Sun Jan 10, 2010 11:32 am
Location: Nottingham

Best encoding and fileformat to use for web design ?

Post by Rippie »

Hi everyone,

I could really do with some education in what kind of encoding/format to use when doing webdesign (HTML, CSS, PHP)

I am currently working on a PHP project at work, but files opens differently when im at home to when im at work. Now at home and work i use windows 7 and the servers i upload my php to is both linux. Now what happens is that when i open a document at home things seems to be fine, but then i go to work, download the files to my work machines and there are no line breaks, and things looks all weird. Now someone told me it is because you use Windows and upload it to linux. so if there is a solution i am hoping it has something to do with my question.

What encoding format to use and what format ? I am using notepad++ and in the settings i can set these settings for new documents.

ENCODING:
ANSI
UTF-8 Without BOM
UTF-8
UCS-2 Big Endian
UCS-2 Little Endian

Format:
Windows
Linux
Mac

If i create a php file on my desktop and open it up in Notepad++ it shows up as DOS/Windows ANSI.

I am hoping someone can teach me a little bit here, so i can use the best encoding and format when working on windows/linux.

Thanks everyone.
Rippie
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: Best encoding and fileformat to use for web design ?

Post by flying_circus »

Windows interprets line breaks as \r\n, where unix interprets them as \n, and mac is typically \r. I dont think its important which format you use, so long as you are consistent. Try setting your editor to linux formatting and see if it clears up.
Rippie
Forum Commoner
Posts: 76
Joined: Sun Jan 10, 2010 11:32 am
Location: Nottingham

Re: Best encoding and fileformat to use for web design ?

Post by Rippie »

How about encoding ?

is UTF-8 what we want to use ?
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: Best encoding and fileformat to use for web design ?

Post by flying_circus »

I'm really not an expert on this subject, but I've switched all of my applications to UTF-8. If you do switch, you'll likely need to be aware of a few things though. There are a few "Cheatsheets" out there, such as this one: http://developer.loftdigital.com/blog/p ... cheatsheet
User avatar
xjake88x
Forum Commoner
Posts: 50
Joined: Sun Aug 01, 2004 7:05 pm

Re: Best encoding and fileformat to use for web design ?

Post by xjake88x »

I'll just point out that mac is unix based.
User avatar
emmbec
Forum Contributor
Posts: 112
Joined: Thu Sep 21, 2006 12:19 pm
Location: Queretaro, Mexico

Re: Best encoding and fileformat to use for web design ?

Post by emmbec »

If you are using special characters like "áéíóúñ" go with UTF8 WITHOUT BOM (BOM is a weird character that sometimes appears on files). If you encode your file with UTF8 those special characters will be displayed just fine. Also, make sure that your database (If you use one) is also in UTF8 UNICODE, that has worked for me just fine and I have solved many problems with special characters.

Hope this helps.
Rippie
Forum Commoner
Posts: 76
Joined: Sun Jan 10, 2010 11:32 am
Location: Nottingham

Re: Best encoding and fileformat to use for web design ?

Post by Rippie »

Atm i am only working on a UK only intranet, so think i will stick to ANSI encoding. How ever i am still having issues with notepad++ and it messes up how the file looks if i open it up in notepad. No linebreaks or anything... very annoying.

Does anyone have experience with notepad++ ? i think my problem is that i make my files on a windows machine and upload them to a linux server. It looks funny :(

Rippie
User avatar
emmbec
Forum Contributor
Posts: 112
Joined: Thu Sep 21, 2006 12:19 pm
Location: Queretaro, Mexico

Re: Best encoding and fileformat to use for web design ?

Post by emmbec »

Rippie wrote:Atm i am only working on a UK only intranet, so think i will stick to ANSI encoding. How ever i am still having issues with notepad++ and it messes up how the file looks if i open it up in notepad. No linebreaks or anything... very annoying.

Does anyone have experience with notepad++ ? i think my problem is that i make my files on a windows machine and upload them to a linux server. It looks funny :(

Rippie

Yes I use Notpad ++ all the time, and what I do is just encode the file in UTF8 WITHOUT BOM format. You don't really need to open the file in any other editor if you are using Notepad++... check to see if the file looks OK on your webserver not on other editors...
Post Reply