Is it safe to use `str_replace` in this case for multibyte strings?