Rework char scanning segmenter logic

This logic is much more internally consistent and prevents it from spitting
out really long segments when it can't find a boundary.

Fixes Bug 64624

Change-Id: I68c09f0bbc599ba0e6fc45a76c8cb8e97d685026