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
Best encoding and fileformat to use for web design ?
Moderator: General Moderators
- 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 ?
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.
Re: Best encoding and fileformat to use for web design ?
How about encoding ?
is UTF-8 what we want to use ?
is UTF-8 what we want to use ?
- 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 ?
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
Re: Best encoding and fileformat to use for web design ?
I'll just point out that mac is unix based.
Re: Best encoding and fileformat to use for web design ?
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.
Hope this helps.
Re: Best encoding and fileformat to use for web design ?
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
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
Re: Best encoding and fileformat to use for web design ?
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...