Convert inserted data from *as-you-type commands to UTF

Fixes #278