Ignore null bytes when measuring character widths in React editor

Fixes #2391