use a decoder function instead of a reader
keep tail as UTF-16 byte array to avoid an error related to characters which use surrogate pair