betto_charset_detector library

A pure-Dart charset detection library for Dart and Flutter applications.

Detects character encodings using a three-stage pipeline:

  1. BOM inspection (deterministic)
  2. UTF-8 structural validation
  3. Candidate probe via the charset package

The single public entry point is detectCharset.

Example:

import 'dart:typed_data';
import 'package:betto_charset_detector/betto_charset_detector.dart';

final encoding = detectCharset(Uint8List.fromList([0xEF, 0xBB, 0xBF, 0x41]));
// encoding == 'utf-8'

Functions

detectCharset(Uint8List bytes) String
Detects the character encoding of the given byte sequence.