2013-04-29 14:31:48 +00:00
|
|
|
|
|
|
|
var assert = require('assert'),
|
2013-04-30 13:49:02 +00:00
|
|
|
chardet = require('../../');
|
|
|
|
|
|
|
|
describe('Unicode', function() {
|
|
|
|
|
|
|
|
var base = __dirname + '/../data/encodings';
|
2013-04-29 14:31:48 +00:00
|
|
|
|
|
|
|
it('should return UTF-16LE', function() {
|
|
|
|
assert.equal(
|
2013-04-30 13:49:02 +00:00
|
|
|
chardet.detectFileSync(base + '/utf16le'),
|
2013-04-29 14:31:48 +00:00
|
|
|
'UTF-16LE'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return UTF-16BE', function() {
|
|
|
|
assert.equal(
|
2013-04-30 13:49:02 +00:00
|
|
|
chardet.detectFileSync(base + '/utf16be'),
|
2013-04-29 14:31:48 +00:00
|
|
|
'UTF-16BE'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return UTF-32LE', function() {
|
|
|
|
assert.equal(
|
2013-04-30 13:49:02 +00:00
|
|
|
chardet.detectFileSync(base + '/utf32le'),
|
2013-04-29 14:31:48 +00:00
|
|
|
'UTF-32LE'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return UTF-32BE', function() {
|
|
|
|
assert.equal(
|
2013-04-30 13:49:02 +00:00
|
|
|
chardet.detectFileSync(base + '/utf32be'),
|
2013-04-29 14:31:48 +00:00
|
|
|
'UTF-32BE'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|