charset_converter
2.5.1, released 4 months ago by pr0gramista.pl
Platform‑native charset encoder/decoder with no Dart dependencies
What it does
Encodes and decodes strings using platform built‑in charset support. Provides a list of available charsets and checks availability.
AI-written summary of version 2.5.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- Need to support non‑UTF‑8 encodings like GBK, Big5, ISO‑8859‑xx
- Want to keep app size small by avoiding external charset libraries
- Working with legacy systems or printers that require specific encodings
Skip it when
- Running on a platform that does not expose the required native APIs
- You need a pure Dart implementation for offline use
- You require custom charset mappings not covered by the platform
Strengths
- Zero Dart dependencies, minimal package size
- Supports Android, iOS, Windows, macOS, Linux
- Handles a wide range of charsets via native APIs
- No external charset maps needed
Weaknesses
- Relies on platform availability; may not support all aliases
- Platform‑specific names can differ
- Requires native code setup for each platform
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Add dependency to pubspec; no extra build steps needed
```dart
Uint8List encoded = await CharsetConverter.encode("windows1250", "Polish has óśćł");
String decoded = await CharsetConverter.decode("windows1250", Uint8List.fromList([0x43,0x7A,0x65,0x9C,0xE6]));
```Alternatives
Packages that do the same job and could replace charset_converter.
- csv_plus
Fast, zero-dependency CSV parser, encoder, streamer, and query engine for Dart.
82Compare - 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 - yaml_writer
A library to write YAML documents supporting Object encoding and dart:convert Converter.
56Compare
Works with
Packages commonly used together with charset_converter: ones it builds on, ones built on it, and its own family.