Skip to content
pubscout

windows1251

2.0.1, released a year ago by ykmnkmi.kz

Cyrillic Windows-1251 (cp1251) character encoding implementation for Dart.

WASM-ready
$ flutter pub add windows1251
Source repository

What it does

Provides tools for encoding and decoding text using the Windows-1251 character set, commonly used for Cyrillic languages. Supports chunked conversion for streaming data and configurable error handling for invalid characters.

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 parse or generate text using the Windows-1251 character encoding.
  • You are working with legacy data or systems utilizing Cyrillic Windows-1251 script.

Skip it when

  • You are working purely with standard UTF-8 encoded text.
  • You need modern multi-language support where standard Unicode is already fully implemented.

Strengths

  • Pure Dart implementation with no external dependencies.
  • Supports chunked conversion for streaming data.
  • Configurable invalid character and byte behavior.

Weaknesses

  • Limited to a single legacy character encoding.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:windows1251/windows1251.dart';

void main() {
  final decoded = windows1251.decode([207, 240, 232, 226, 229, 242, 33]);
  print(decoded); // Output: 'Привет!'

  final encoded = windows1251.encode('Привет!');
  print(encoded); // Output: [207, 240, 232, 226, 229, 242, 33]
}

Alternatives

Packages that do the same job and could replace windows1251.

  • csv_plus

    Fast, zero-dependency CSV parser, encoder, streamer, and query engine for Dart.

  • standard_message_codec

    Binary codec for efficient encoding/decoding of Dart objects without a schema.

  • qs_dart

    A query string encoding and decoding library for Dart ported from JavaScript's qs.

  • asn1lib

    Encodes and decodes ASN.1 objects using BER byte encoding in Dart.