Lines Matching refs:from
38 test('utf-8', Buffer.from('$', 'utf-8'), '$');
39 test('utf-8', Buffer.from('¢', 'utf-8'), '¢');
40 test('utf-8', Buffer.from('€', 'utf-8'), '€');
41 test('utf-8', Buffer.from('', 'utf-8'), '');
51 Buffer.from([0xCB, 0xA4, 0x64, 0xE1, 0x8B, 0xA4, 0x30, 0xE3, 0x81, 0x85]),
65 test('utf-8', Buffer.from('C9B5A941', 'hex'), '\u0275\ufffdA');
66 test('utf-8', Buffer.from('E2', 'hex'), '\ufffd');
67 test('utf-8', Buffer.from('E241', 'hex'), '\ufffdA');
68 test('utf-8', Buffer.from('CCCCB8', 'hex'), '\ufffd\u0338');
69 test('utf-8', Buffer.from('F0B841', 'hex'), '\ufffdA');
70 test('utf-8', Buffer.from('F1CCB8', 'hex'), '\ufffd\u0338');
71 test('utf-8', Buffer.from('F0FB00', 'hex'), '\ufffd\ufffd\0');
72 test('utf-8', Buffer.from('CCE2B8B8', 'hex'), '\ufffd\u2e38');
73 test('utf-8', Buffer.from('E2B8CCB8', 'hex'), '\ufffd\u0338');
74 test('utf-8', Buffer.from('E2FBCC01', 'hex'), '\ufffd\ufffd\ufffd\u0001');
75 test('utf-8', Buffer.from('CCB8CDB9', 'hex'), '\u0338\u0379');
80 test('utf-8', Buffer.from('EDA0B5EDB08D', 'hex'),
84 test('ucs2', Buffer.from('ababc', 'ucs2'), 'ababc');
87 test('utf16le', Buffer.from('3DD84DDC', 'hex'), '\ud83d\udc4d'); // thumbs up
91 assert.strictEqual(decoder.write(Buffer.from('E1', 'hex')), '');
102 const inputBuffer = Buffer.from(arrayBufferViewStr.repeat(8), 'utf8');
112 assert.strictEqual(decoder.write(Buffer.from('E18B', 'hex')), '');
116 assert.strictEqual(decoder.write(Buffer.from('\ufffd')), '\ufffd');
120 assert.strictEqual(decoder.write(Buffer.from('\ufffd\ufffd\ufffd')),
125 assert.strictEqual(decoder.write(Buffer.from('EFBFBDE2', 'hex')), '\ufffd');
129 assert.strictEqual(decoder.write(Buffer.from('F1', 'hex')), '');
130 assert.strictEqual(decoder.write(Buffer.from('41F2', 'hex')), '\ufffdA');
135 assert.strictEqual(decoder.text(Buffer.from([0x41]), 2), '');
139 assert.strictEqual(decoder.write(Buffer.from('3DD8', 'hex')), '');
140 assert.strictEqual(decoder.write(Buffer.from('4D', 'hex')), '');
141 assert.strictEqual(decoder.write(Buffer.from('DC', 'hex')), '\ud83d\udc4d');
145 assert.strictEqual(decoder.write(Buffer.from('3DD8', 'hex')), '');
149 assert.strictEqual(decoder.write(Buffer.from('3DD8', 'hex')), '');
150 assert.strictEqual(decoder.write(Buffer.from('4D', 'hex')), '');
154 assert.strictEqual(decoder.write(Buffer.from('3DD84D', 'hex')), '\ud83d');
169 assert.strictEqual(decoder.write(Buffer.from('f69b', 'hex')), '');
170 assert.strictEqual(decoder.write(Buffer.from('d1', 'hex')), '\ufffd\ufffd');
172 assert.strictEqual(decoder.write(Buffer.from('f4', 'hex')), '');
173 assert.strictEqual(decoder.write(Buffer.from('bde5', 'hex')), '\ufffd\ufffd');