Avoid un-necessary decode in startsWith/endsWith

As requested in #2503.

Perhaps it's overkill?
It's utf8,  so é is actually two code units,  and the range "é" does not contain any character whose value is that of the first code unit in é.