Some UTF8 code from another project long ago, to port forward.