mirror of
https://github.com/nodejs/node.git
synced 2025-05-10 22:33:26 +00:00

When node began using the OneByte API (f150d56
) it also switched to
officially supporting ISO-8859-1. Though at the time no new encoding
string was introduced.
Introduce the new encoding string 'latin1' to be more explicit. The
previous 'binary' and documented as an alias to 'latin1'. While many
tests have switched to use 'latin1', there are still plenty that do both
'binary' and 'latin1' checks side-by-side to ensure there is no
regression.
PR-URL: https://github.com/nodejs/node/pull/7111
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
23 lines
595 B
JavaScript
23 lines
595 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
var path = require('path');
|
|
var fs = require('fs');
|
|
var got_error = false;
|
|
|
|
var filename = path.join(common.fixturesDir, 'does_not_exist.txt');
|
|
fs.readFile(filename, 'latin1', function(err, content) {
|
|
if (err) {
|
|
got_error = true;
|
|
} else {
|
|
console.error('cat returned some content: ' + content);
|
|
console.error('this shouldn\'t happen as the file doesn\'t exist...');
|
|
assert.equal(true, false);
|
|
}
|
|
});
|
|
|
|
process.on('exit', function() {
|
|
console.log('done');
|
|
assert.equal(true, got_error);
|
|
});
|