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:
Joshua Sherman 2014-01-26 15:09:16 -05:00
parent 782bad5c02
commit 0810302e4f
2 changed files with 3 additions and 3 deletions

View file

@ -86,7 +86,7 @@ class StringTest extends PHPUnit_Framework_TestCase
{
return [
['foo bar', 3, true, '<span title="foo bar">foo&hellip;</span>'],
['foo bar', 3, false, 'foo...'],
['foo bar', 3, false, 'foo&hellip;'],
['foo bar', 7, true, 'foo bar'],
['foo bar', 8, true, 'foo bar'],
];