- $this->emotes[] = preg_replace('/\d+$/', '', strtolower(substr($this->text, $coords[0], $coords[1] - $coords[0] + 1)));
- for ($i = intval($coords[0]); $i <= intval($coords[1]); ++$i) {
- $this->emoteless[$i] = ' ';
- }
+ $emote_text = mb_substr($this->text, $coords[0], $coords[1] - $coords[0] + 1);
+ $this->original_emotes[] = $emote_text;
+ $this->emotes[] = preg_replace('/\d+$/', '', strtolower($emote_text));
+ $this->emoteless = mb_substr($this->emoteless, 0, $coords[0]).str_repeat(' ', $coords[1] - $coords[0] + 1).mb_substr($this->emoteless, $coords[1] + 1);