Read UTF8 string lengths correctly when checking closed captions (part of #1446).