betto_charset_detector library
A pure-Dart charset detection library for Dart and Flutter applications.
Detects character encodings using a three-stage pipeline:
- BOM inspection (deterministic)
- UTF-8 structural validation
- Candidate probe via the
charsetpackage
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.