! the encoding function improperly handled surrogate pairs