
Originally Posted by
andrew.koltyakov
We have the same encoding problem with last character in "last viewed" web-part where record name is clipped. Although codepages everywhere as possible are set to UTF-8. Very wierd.

I've solved my problem. Ufortunatly for topic creater the reasons of my issue and papamike's are different natures. The reason of "�" in the end of clipped phrasies of Last Viewed in my case is that when cutting UTF-8 string for odd count of unicode letters, substring function tries to cut multibyte letter apart, so "�" apeared.
My resolution of issue was to replace the following part of /include/MVC/View/SugarView.php:
PHP Code:
foreach ( $history as $key => $row ) {
$history[$key]['item_summary_short'] = getTrackerSubstring($row['item_summary']);
$history[$key]['image'] = SugarThemeRegistry::current()
->getImage($row['module_name'],'border="0" align="absmiddle" alt="'.$row['item_summary'].'"');
}
for:
PHP Code:
$CrD_LastViewed_Length = 11;
foreach ( $history as $key => $row ) {
$CrD_LastViewed_ShortName = $row['item_summary'];
if (mb_strlen($CrD_LastViewed_ShortName,'UTF-8') > $CrD_LastViewed_Length){
$CrD_LastViewed_ShortName = mb_substr($CrD_LastViewed_ShortName,0,$CrD_LastViewed_Length,'UTF-8'). '...';
}
$history[$key]['item_summary_short'] = $CrD_LastViewed_ShortName;
$history[$key]['image'] = SugarThemeRegistry::current()
->getImage($row['module_name'],'border="0" align="absmiddle" alt="'.$row['item_summary'].'"');
}
You can setup length of Last Viewed elements by variable $CrD_LastViewed_Length.
Nevertheless, I do not sure that it the best solution.
Bookmarks