updated unit tests to reflect the TextEncoder interface