Notepad++ file format problems (UTF-8)

greg's picture

He has: 1,581 posts

Joined: Nov 2005

I have been using Notepad++ for a while now
I like some of the functions and options it gives
But I have a problem

There is myself and another guy uploading files to our server.
When I make or edit a file and the other guy opens it (he uses Dreamweaver) it messes the alignment of the code in the file, so when the other guy opens it there are blank lines everywhere and spaces and is almost unreadable
OR there are NO blank spaces or alignment and the whole file of code is one block

And also, in the top corner of the webpage (of the file i edit or make) there are these chars


If I use format of Windows and ANSI, those chars aren't there but the file is still unreadable for the other guy in Dreamweaver
If I use Unix and UTF-8 OR Windows and UTF-8 OR win or unix with UTF-8 without BOM those chars are NOT there?

Is it Notepadd++? or do I have some settings wrong somewhere?
Is it Dreamweaver or his settings? or a combination?

Cheers

greg's picture

He has: 1,581 posts

Joined: Nov 2005

No-one knows anything about this?
I changed the thread title to attract more readers, simply because 7 views must mean it was something people knew they wouldn't be able to help with
EDIT: ok it doesnt seem to let me edit the thread title Confused

basically, unless I use ANSI format in my notepad++ the webpage has this  in the top left hand corner

if I use UTF-8 it has the  in the webpage

From what I read I should be using UTF-8, but can't beacue of this problem

I'm about to change my preferred editor, but don't want to as I got familiar with this one, and like pretty much everything about it

anyone got ANY ideas at all???

He has: 629 posts

Joined: May 2007

Hi Greg,
You don't say what your preference is - UTF-8 or ANSI?
Anyway, you diagnosis is correct - those odd characters at the start of the file are due to the UTF Byte-Order Mark (BOM). You both need to turn this mark off if you want to use UTF-8 as it's meaningless anyway.

From what I remember about Dreamweaver, it has problems with UTF-8. You also need to check that you are uploading and downloading files using binary mode - the default mode is ANSI, which converts line ends to CR+LF as well as creating those extra characters from the BOM.

The advantage of using Unicode (UTF-8 or other UTF coding) is that it can display many more characters than ANSI. You also do not need to use HTML entities for such things as "curly quote marks" and other special characters. For most other writing in English, however, ANSI and UTF-8 are identical, so you may just decide to use ANSI and forgo the few benefits (for writing in English).

The formatting problem sounds like a conflict in line end settings. Windows (and Dreamweaver) uses a combination of CR+LF line ends by default. But Unix uses LF alone. Check your settings in Notepad++ and those in Dreamweaver to make sure you are both (a) using the same line ends, and (b) both FTP-ing your files with the same (binary or ANSI) settings.

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

greg's picture

He has: 1,581 posts

Joined: Nov 2005

Thank you very much

I had tried all combinations of formats
Windows/Dos...Unix with UTF-8...UTF-8 without BOM and ANSI

and whatever I did always seemed to put those chars in the web page

I had my ftp client (Filezilla) set to auto file type
I changed that to binary and that resolved the issue

thanks again..I never thought that it would be making the problem so never bothered trying to change it. I presumed Filezilla was choosing correctly

I don't really have a preference towards ANSI vs UTF-8, more so which is the best to use
As far as I read UTF-8 is the better one. and with your explanation above seems that is indeed the case.

It works fine now, and when anyone else opens the file in their editor too

Thanks again

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.