Howdy folks
I'm having this problem with limiting characters in latest news feature in a multilingual website.
Everything seems to be working ok, except when the last character (ie. limit(10) and the 10 th character) is a special character. It produces character error. This weird question mark. Please see the attached screenshot.
I've charset UTF-8 in _config and template files, so that seems to be ok. To be specific, i'm using scandic letters. Anyone has any ideas, or encountered this kind a behaviour before?
Here's the code in page.ss:
<% if News %>
<% control News %>
<div class="NewsFront">
<h5><a href="$Link">$MenuTitle</a></h5>
<p>$Content.LimitCharacters(80)</p>
</div>
<% end_control %>
<% end_if %>
And here's the function in page.php:
function News($limit = 3) {
$filter = 'StartPublish < NOW() AND EndPublish > NOW()';
$order = 'Created DESC';
return DataObject::get('NewsItem', $filter, $order, null, $limit);
}