Fixed issue with UTF-8 2-byte characters
Characters were being split up and causing invalid sequences when using `substr()`. Went ahead and updated to use `mb_strcut()` and forcing the character encoding to UTF-8. I think the plan down the road will be to set the internal encoding to UTF-8 but I am not currently sure how that could effect the rest of the system (perhaps it won't). Closes #39
This commit is contained in:
parent
782bad5c02
commit
0810302e4f
2 changed files with 3 additions and 3 deletions
|
@ -225,11 +225,11 @@ class String
|
|||
{
|
||||
if ($hover == true)
|
||||
{
|
||||
$string = '<span title="' . $string . '">' . substr($string, 0, $length) . '…</span>';
|
||||
$string = '<span title="' . $string . '">' . mb_strcut($string, 0, $length, 'UTF-8') . '…</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$string = substr($string, 0, $length) . '...';
|
||||
$string = mb_strcut($string, 0, $length, 'UTF-8') . '…';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue