Get byte counts right when indexing UTF-8 characters.

Caught by the Selenium tests.  I was sure these got encoded to ASCII by JSON,
but apparently not :)