2020-03-30 03:42:04 +00:00
|
|
|
import * as chardet from '..';
|
|
|
|
|
|
|
|
describe('Unicode', () => {
|
2020-09-23 02:16:38 +00:00
|
|
|
const base = __dirname + '/../test/data/encodings';
|
2020-03-30 03:42:04 +00:00
|
|
|
|
|
|
|
it('should return UTF-16LE', () => {
|
|
|
|
expect(chardet.detectFileSync(base + '/utf16le')).toBe('UTF-16LE');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return UTF-16BE', () => {
|
|
|
|
expect(chardet.detectFileSync(base + '/utf16be')).toBe('UTF-16BE');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return UTF-32LE', () => {
|
|
|
|
expect(chardet.detectFileSync(base + '/utf32le')).toBe('UTF-32LE');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return UTF-32BE', () => {
|
|
|
|
expect(chardet.detectFileSync(base + '/utf32be')).toBe('UTF-32BE');
|
|
|
|
});
|
|
|
|
});
|