2013-04-30 13:49:02 +00:00
|
|
|
var assert = require('assert'),
|
2013-11-22 04:40:19 +00:00
|
|
|
chardet = require('../../');
|
2013-04-30 13:49:02 +00:00
|
|
|
|
|
|
|
describe('Multybyte Character Sets', function() {
|
|
|
|
|
2013-11-22 04:40:19 +00:00
|
|
|
var base = __dirname + '/../data/encodings';
|
|
|
|
|
|
|
|
it('should return SHIFT-JIS', function() {
|
|
|
|
assert.equal(
|
|
|
|
chardet.detectFileSync(base + '/shiftjis'),
|
|
|
|
'Shift-JIS'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return GB18030', function() {
|
|
|
|
assert.equal(
|
|
|
|
chardet.detectFileSync(base + '/gb18030'),
|
|
|
|
'GB18030'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return Big5', function() {
|
|
|
|
assert.equal(
|
|
|
|
chardet.detectFileSync(base + '/big5'),
|
|
|
|
'Big5'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return EUC-JP', function() {
|
|
|
|
assert.equal(
|
|
|
|
chardet.detectFileSync(base + '/euc_jp'),
|
|
|
|
'EUC-JP'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return EUC-KR', function() {
|
|
|
|
assert.equal(
|
|
|
|
chardet.detectFileSync(base + '/euc_kr'),
|
|
|
|
'EUC-KR'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|