Add encodeUnits() to utf8/utf16/sjis.

So that we know how many units (e.g. u16s) are needed to encode.

Also, don't call the index in utf-16 a byteIndex, since it's not.  Unfortunately this makes a cross dependency on updating ppsspp (hrydgard/ppsspp#6010).

-[Unknown]