Skip to content
pubscout

charset_converter

2.5.1, released 4 months ago by pr0gramista.pl

Platform‑native charset encoder/decoder with no Dart dependencies

$ flutter pub add charset_converter
Source repository

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.

Works with

Packages commonly used together with charset_converter: ones it builds on, ones built on it, and its own family.