mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 13:40:37 +00:00

PR-URL: https://github.com/nodejs/node/pull/56222 Fixes: https://github.com/nodejs/node/issues/56219 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com>
18 lines
484 B
JavaScript
18 lines
484 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
const test = require('node:test');
|
|
const assert = require('node:assert');
|
|
|
|
test('TextDecoder correctly decodes windows-1252 encoded data', { skip: !common.hasIntl }, () => {
|
|
const latin1Bytes = new Uint8Array([0xc1, 0xe9, 0xf3]);
|
|
|
|
const expectedString = 'Áéó';
|
|
|
|
const decoder = new TextDecoder('windows-1252');
|
|
const decodedString = decoder.decode(latin1Bytes);
|
|
|
|
assert.strictEqual(decodedString, expectedString);
|
|
});
|