I am writing an arabic website and saving templates as UTF8 (using notepad++) , this makes an extra new line on each file/template include , is there anyway to fix this problem without the need to save the file in ascii format ?
thank you .
I am writing an arabic website and saving templates as UTF8 (using notepad++) , this makes an extra new line on each file/template include , is there anyway to fix this problem without the need to save the file in ascii format ?
thank you .
I think you could try to open the files and then select "UTF-8 without BOM" as encoding and then save. That might explain the extra lines.
First of all you must have the following information in hands:
Usually the EOL Character is the "\n" meta character that means "new line". This goes fine for almost any unix based system that'll also return the column pointer to the start of the line. Windows based systems don't have this second behavior, adding a position to the line pointer, but the column pointer will remain the same. So, to fix this issue, Windows based systems use an additional "\r" meta character just before the "\n" one. "\r" stands for "carriage return" and is referred to ancient technology. It's function is to reset the column pointer to the start of the line.
In binary processing instructions the "You should buy a byke.\rYou shalt" string should be translated to "You shalt buy a byke." since at the "\r" column position the interpreter will reset the column pointer to the start of the line and will start to overwrite by the bit sequence just after (the "\r" meta character).
So in Windows based systems you should use "\r\n" for carriage return and line feed. This will behave fine on Unix based systems also.
Beware on transfers... Check your origin and destination charsets. If they differ from each other it may cause doubled or trimmed line feeds. Also you can get some corrupted characters in your strings.
Original:
<div id='tmp'>
deja vú
</div>
Doubled:
<div id='tmp'>
deja vú
</div>
Trimmed:
<div id='tmp'> deja v� </div>