#2500 Use TextEncoder instead of Buffer to ensure support in other JS environments Fixes issues like #2499 and #2493 where use of Buffer.byteLength was causing errors in some runtime environments. See the changelog for more details.