Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

iconv-jschardet

bluelovers1.3kISC2.0.33TypeScript support: included

Convert/auto-detection Character encodings in JavaScript ( iconv-lite, jschardet )

big-5, big5, buffer, charset, chinese, conv, convert, create, decode, encode, encoding, euc-jp, extra, gb2312, gbk, iconv, iconv-lite, icu, jschardet, output, read, shift_jis, text, unicode, utf-8

readme

iconv-jschardet

Convert/auto-detection Character encodings in JavaScript ( iconv-lite, jschardet )

npm install iconv-jschardet

demo

see fs-iconv

BufferFrom

import * as iconv from 'iconv-jschardet';

import iconv from 'iconv-jschardet';
const BIG5_HEX = 'a6b8b160a5ceb0eaa672bcd0b7c7a672c5e9aaed';

// utf8 buffer
iconv.BufferFrom(Buffer.from(BIG5_HEX, 'hex'), 'utf8')
iconv.BufferFrom(BIG5_HEX, 'utf8', 'hex')

// big5 buffer
iconv.BufferFrom(Buffer.from(BIG5_HEX, 'hex'), 'big5')
iconv.BufferFrom(BIG5_HEX, 'big5', 'hex')

iconv

const BIG5_STR = "\xa6\xb8\xb1\x60\xa5\xce\xb0\xea\xa6\x72\xbc\xd0\xb7\xc7\xa6\x72\xc5\xe9\xaa\xed";
const BIG5_BUF = Buffer.from('a6b8b160a5ceb0eaa672bcd0b7c7a672c5e9aaed', 'hex');

const BIG5_UTF8_BUF = Buffer.from('e6 ac a1 e5 b8 b8 e7 94 a8 e5 9c 8b e5 ad 97 e6 a8 99 e6 ba 96 e5 ad 97 e9 ab 94 e8 a1 a8'.replace(/\s/g, ''), 'hex');
// same as jschardet.detect
iconv.detect(BIG5_STR);
iconv.detect(BIG5_BUF);

// big5 buffer
iconv.encode(BIG5_STR, 'big5');
iconv.encode(BIG5_BUF, 'big5');
// utf8 buffer
iconv.encode(BIG5_STR, 'utf8');
iconv.encode(BIG5_BUF, 'utf8');

// utf8 string
iconv.decode(BIG5_STR);
iconv.decode(BIG5_BUF);
iconv.skipDecodeWarning(bool: boolean = true)
iconv.disableCodecDataWarn(bool: boolean = true)

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

2.0.33 (2024-08-29)

🛠 Build System

📌 Dependencies

2.0.32 (2022-10-02)

🔖 Miscellaneous

2.0.31 (2022-09-29)

🔖 Miscellaneous

2.0.30 (2022-09-29)

🔖 Miscellaneous

2.0.29 (2022-09-28)

🚨 Tests

🔖 Miscellaneous

2.0.28 (2022-08-11)

♻️ Chores

📌 Dependencies

2.0.27 (2022-08-11)

📌 Dependencies

2.0.26 (2022-05-11)

♻️ Chores

🔖 Miscellaneous

2.0.25 (2022-05-11)

♻️ Chores

2.0.24 (2021-12-29)

🛠 Build System

⚙️ Continuous Integration

🔖 Miscellaneous

2.0.23 (2021-12-29)

🛠 Build System

⚙️ Continuous Integration

🔖 Miscellaneous

2.0.22 (2021-12-29)

🛠 Build System

⚙️ Continuous Integration

🔖 Miscellaneous

2.0.21 (2021-08-30)

✨ Features

2.0.20 (2021-08-20)

✨ Features

  • support ArrayBuffer in BufferFrom (3225139)

2.0.19 (2021-08-20)

✨ Features

  • support iconv-lite options (b099173)

2.0.18 (2021-08-13)

♻️ Chores

2.0.17 (2021-07-08)

🛠 Build System

2.0.16 (2021-06-16)

🚨 Tests

♻️ Chores

🔖 Miscellaneous

2.0.15 (2021-06-15)

🚨 Tests

♻️ Chores

🔖 Miscellaneous

2.0.14 (2021-06-15)

♻️ Chores

🔖 Miscellaneous

2.0.13 (2021-06-15)

♻️ Chores

2.0.12 (2021-02-12)

🛠 Build System

2.0.11 (2020-08-08)

🛠 Build System

♻️ Chores

2.0.10 (2020-07-05)

♻️ Chores

2.0.9 (2020-06-20)

📦 Code Refactoring

2.0.8 (2020-06-09)

Note: Version bump only for package iconv-jschardet

2.0.7 (2020-06-09)

Note: Version bump only for package iconv-jschardet

2.0.6 (2020-05-29)

Note: Version bump only for package iconv-jschardet

2.0.5 (2020-05-03)

Note: Version bump only for package iconv-jschardet

2.0.4 (2020-05-01)

Features

  • add BufferFrom default encoding (1c6b39c)

BREAKING CHANGES

  • add BufferFrom default encoding

2.0.3 (2020-05-01)

Note: Version bump only for package iconv-jschardet

2.0.2 (2020-05-01)

Note: Version bump only for package iconv-jschardet

2.0.1 (2020-05-01)

Code Refactoring

  • update typescript and test (97dcebd)
  • update typescript and test (5b661d9)

BREAKING CHANGES

  • update typescript
  • update typescript