charset
2.0.1, released 3 years ago by shirne.com
Charset encoding and decoding library for various text encodings in Dart.
What it does
Provides encoding and decoding support for various character sets including ISO series, Windows series, GBK, EUC-JP, EUC-KR, and Shift-JIS. It also supports charset detection, canEncode, and canDecode functions.
AI-written summary of version 2.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to encode or decode legacy or regional character encodings like GBK, Shift-JIS, or EUC-JP.
- You need to detect the character encoding of byte data.
Skip it when
- You only need standard UTF-8 or ASCII encoding which is already built into Dart's core libraries.
Strengths
- Supports a wide variety of legacy and international character sets.
- Includes features for charset detection and validation (canEncode/canDecode).
Weaknesses
- Limited documentation beyond basic code examples.
- No topics specified on pub.dev.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Not documented
import 'package:charset/charset.dart';
main() {
print(utf16.decode([254, 255, 78, 10, 85, 132, 130, 229, 108, 52]));
print(utf16.encode("上善若水"));
}Alternatives
Packages that do the same job and could replace charset.
- cbor
A Dart library for RFC8949‑compliant CBOR encoding and decoding.
89Compare - enough_convert
Support for character encodings and codecs missing from dart:convert.
79Compare - flutter_charset_detector
Detect and decode the character encoding of text bytes automatically.
69Compare - fast_gbk
Fast GBK codec for Dart, supports encoding/decoding and stream API.
45Compare
Works with
Packages commonly used together with charset: ones it builds on, ones built on it, and its own family.
- zxing_libBuilt on charsetA pure Dart port of ZXing to encode and decode multiple 1D and 2D barcodes.
- audio_metadata_readerBuilt on charsetPure Dart metadata reader and writer for MP3, MP4, FLAC, OGG, Opus, WAV, AIFF, and APE files.
- dart_pdf_readerBuilt on charsetPure‑dart PDF parser that reads PDF structures from a byte stream.
- mercury_clientBuilt on charsetPortable HTTP client with browser and native support and memory cache
- esc_pos_dartBuilt on charsetESC/POS thermal WiFi printer support for Dart.