It appears that my previous patch was always using String.length. This new one uses UTF8.length on valid UTF8 strings and String.length on others.
It appears that my previous patch was always using String.length. This new one uses UTF8.length on valid UTF8 strings and String.length on others.