public function safeTruncate($length, $substring = '')
    {
        if ($length >= $this->getLength()) return $this;

        // Need to further trim the string so we can append the substring
        $substringLength = UTF8::strlen($substring, $this->encoding);
        $length -= $substringLength;

        $truncated = UTF8::substr($this->scalarString, 0, $length, $this->encoding);

        // If the last word was truncated
        if (UTF8::strpos($this->scalarString, ' ', $length - 1, $this->encoding) != $length)
        {
            // Find pos of the last occurrence of a space, get up to that
            $lastPos = UTF8::strrpos($truncated, ' ', 0, $this->encoding);
            if (!is_integer($lastPos)) $lastPos = 0;
            $truncated = UTF8::substr($truncated, 0, $lastPos, $this->encoding);
        }

        return $this->newSelf($truncated . $substring);
    }