From ebea6869e16eb5279bb3aeaa3035a86630276e2c Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Tue, 10 Jan 2017 15:03:56 -0800 Subject: [PATCH] set UTF-8 for mb_substr attempting to fix in php 5.5 --- lib/Formats/Twitter.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Formats/Twitter.php b/lib/Formats/Twitter.php index c6c8b88..4935a69 100644 --- a/lib/Formats/Twitter.php +++ b/lib/Formats/Twitter.php @@ -41,7 +41,10 @@ class Twitter { $refs = []; // Only use the "display" segment of the text - $text = mb_substr($tweet->full_text, $tweet->display_text_range[0], $tweet->display_text_range[1]-$tweet->display_text_range[0]); + $text = mb_substr($tweet->full_text, + $tweet->display_text_range[0], + $tweet->display_text_range[1]-$tweet->display_text_range[0], + 'UTF-8'); if(property_exists($tweet, 'retweeted_status')) { // No content for retweets