Smarty includes : strange empty characters
-
14-04-2021 - |
Question
I'm experiencing strange white space when loading Smarty templates in a Prestashop installation. It happened without me noticing it so I can't trace it back to a specific change.
It seems to happen just before the include and generates some empty space in the browser.
Here is a sample of the HTML where this whitespace occurs:
http://twi.tl/051i3o0T062F1X2L3u3k
Moving your cursor in the file you will notice the blank character just after the #main div and somewhere before the #customization div.
Looking in forums, some posts talk about the Byte Order Mark being outputted.
Aside from moving a comment through every line of Prestashop to try to find a needle in a haystack, is there perhaps a more intelligent approach to finding the rogue characters. Perhaps a function which allows me to pinpoint at what line of what file that line of the output is generated.
Thank you
An yes I will install an SVN
Solution 2
I've found the solution. The file had been saved with the Byte Order Mark (BOM).
I have found a Coda plugin to remove the BOM from PHP files in Coda. Saving the file "Without byte order mark" effectively got rid of extra white space being outputted to the browser.
The plugin can be found http://panic.com/coda/developer/community/plugins.php and is called Write UTF BOM.
OTHER TIPS
i have used notpad ++ to save the template files as UTF-8 without BOM and it is worked