Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let utf8encoder = new TextEncoder('utf-8');
- console.log(utf8encoder.encode('福')); // [231, 166, 143]
- let win1251decoder = new TextDecoder('windows-1251');
- let bytes = new Uint8Array([207, 240, 232, 226, 229, 242, 44, 32, 236, 232, 240, 33]);
- console.log(win1251decoder.decode(bytes)); // Привет, мир!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement