It would be great if the functions
strlen(get_the_title()) >= 45
and
substr(get_the_title(), 0, 45)

could be replaced by
mb_strlen()
and
mb_substr()