2020-03-30 03:42:04 +00:00
|
|
|
import * as chardet from '..';
|
|
|
|
|
|
|
|
describe('Multibyte Character Sets', () => {
|
2020-09-23 02:16:38 +00:00
|
|
|
const base = __dirname + '/../test/data/encodings';
|
2020-03-30 03:42:04 +00:00
|
|
|
|
2020-07-03 03:56:02 +00:00
|
|
|
it('should return Shift_JIS', () => {
|
|
|
|
expect(chardet.detectFileSync(base + '/shiftjis')).toBe('Shift_JIS');
|
2020-03-30 03:42:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should return GB18030', () => {
|
|
|
|
expect(chardet.detectFileSync(base + '/gb18030')).toBe('GB18030');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return Big5', () => {
|
|
|
|
expect(chardet.detectFileSync(base + '/big5')).toBe('Big5');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return EUC-JP', () => {
|
|
|
|
expect(chardet.detectFileSync(base + '/euc_jp')).toBe('EUC-JP');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return EUC-KR', () => {
|
|
|
|
expect(chardet.detectFileSync(base + '/euc_kr')).toBe('EUC-KR');
|
|
|
|
});
|
|
|
|
});
|