when using render or layout()->content, in case the .phtml file is saved as UTF-8, Zend is adding extra string inside the DIV forcing the layout to show one line below the expected.
<div class="content">
<?php echo $this->layout()->content ?>
<!-- end .content --></div>
<div class="sidebar2">
<?php echo $this->render('/scripts/bar.phtm'); ?>
<!-- end .sidebar2 --></div>
given that bar.phtml is
<div class="someclass">
<p>Any foreing accentuated text like 'não'</p>
</div>
The result is that the special chars appears as a Question Mark if the file is in another codepage than UTF-8. If in UTF-8 the result will be
UTF-8
<div class="someclass">" "
<p>Any foreing accentuated text like 'não'</p>
</div>
Other charset
<div class="someclass">
<p>Any foreing accentuated text like 'n?o'</p>
</div>
That extra string forces flow my layout no line below the original position and its added by the result of calling render or layout.
Anyone knows how to get it right?
Have you checked that Byte Order Mark (BOM) is not prepended to your phtml file when saving in UTF-8?