utf8.js 307 B

1234567
  1. // N2O UTF-8 Support
  2. function utf8_dec(ab) { return (new TextDecoder()).decode(ab); }
  3. function utf8_enc(ab) { return (new TextEncoder("utf-8")).encode(ab); }
  4. function utf8_arr(ab) { if (!(ab instanceof ArrayBuffer)) ab = new Uint8Array(utf8_enc(ab)).buffer;
  5. return utf8_dec(ab); }