Search packages, repositories and app categories

Package detailsv1.7.1

enough_convert

Support for character encodings / charsets / codecs missing from `dart:convert` - ISO 8859 / Latin, Windows, DOS, GBK, Big5, and KOI8 R/U.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
52.4K
Likes
25
Pub points
150

Install package

flutter pub add enough_convert

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Enough Convert extends Dart's built-in `dart:convert` with support for additional character encodings such as ISO 8859, Windows, DOS, GBK, Big5, and KOI8 R/U. It fills gaps in handling legacy and non-UTF-8 text formats commonly used in internationalized applications. Ideal for parsing or generating text in older systems or region-specific encodings, this package ensures accurate data processing across diverse environments.

Use cases

  • Parsing legacy text files with non-UTF-8 encodings
  • Handling multilingual content in regional character sets
  • Converting between different codepages in desktop and mobile apps
  • Processing data from old systems using DOS or Windows encodings
  • Supporting East Asian text (GBK, Big5) in internationalized apps
  • Ensuring correct display of Cyrillic text (KOI8-R/U)

Key features

  • Supports ISO 8859, Windows, DOS, GBK, Big5, and KOI8 encodings
  • Lightweight and compatible with all Flutter platforms
  • Simple API extending `dart:convert`
  • No external dependencies
  • Accurate encoding/decoding for legacy formats
  • Cross-platform consistency

Suitable for

  • Developers working with legacy data sources
  • Apps requiring multilingual text support
  • Projects involving East Asian or Cyrillic character sets
  • Mobile and desktop apps needing codepage conversion
  • Internationalization teams handling non-UTF-8 content

Considerations

  • Not needed for UTF-8-only workflows
  • Limited to specific legacy encodings
  • May require knowledge of target encoding standards
  • Performance impact negligible but present for large-scale conversions
  • Best used when dealing with known non-UTF-8 input/output

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Support for character encodings / charsets / codecs missing from dart:convert.

Supports the following encodings:

  • Latin / ISO 8859 encodings:
    • Latin 1 / ISO 8859-1
    • Latin 2 / ISO 8859-2
    • Latin 3 / ISO 8859-3
    • Latin 4 / ISO 8859-4
    • Latin 5 / ISO 8859-5
    • Latin 6 / ISO 8859-6
    • Latin 7 / ISO 8859-7
    • Latin 8 / ISO 8859-8
    • Latin 9 / ISO 8859-9
    • Latin 10 / ISO 8859-10
    • Latin 11 / ISO 8859-11
    • Latin 13 / ISO 8859-13
    • Latin 14 / ISO 8859-14
    • Latin 15 / ISO 8859-15
    • Latin 16 / ISO 8859-16
  • Windows Codepage Encodings:
    • Windows-1250 / cp-1250
    • Windows-1251 / cp-1251
    • Windows-1252 / cp-1252
    • Windows-1253 / cp-1253
    • Windows-1254 / cp-1254
    • Windows-1255 / cp-1255
    • Windows-1256 / cp-1256
  • DOS Codepage Encodings:
    • cp-850
  • GBK (compatible with GB-2312)
  • KOI8
    • KOI8-R
    • KOI8-U
  • Big5

Usage

Using enough_convert is pretty straight forward:

import 'package:enough_convert/enough_convert.dart';

main() {
  final codec = const Windows1252Codec(allowInvalid: false);
  final input = 'Il faut être bête quand même.';
  final encoded = codec.encode(input);
  final decoded = codec.decode([...encoded]);
  print('${codec.name}: encode "$input" to "$encoded"');
  print('${codec.name}: decode $encoded to "$decoded"');

}

Installation

Add this dependency your pubspec.yaml file:

dependencies:
  enough_convert: ^1.6.0

The latest version or enough_convert is enough_convert version.

Wait, what is this about?

Dylan (not associated with this project in any way) explains the world of text encoding quite well: Plain text? Really?

It's 2022, do we still need this?

Short answer: yes.

Long answer: yes, there are still many web pages, emails and other content out there that is encoded in various text encodings.

Features and bugs

Please file feature requests and bugs at the issue tracker.

Null-Safety

enough_convert is null-safe from v1.0.0 onward.

License

enough_convert is licensed under the commercial friendly Mozilla Public License 2.0

Categories

Source repository

Projects using this package