amake / flutter_charset_detector

Flutter plugin that detects the charset (encoding) of text bytes
https://pub.dev/packages/flutter_charset_detector
19 stars 11 forks source link
android charset charset-detector encoding flutter ios plugin text-encoding

flutter_charset_detector

Automatically detect and decode the charset (character encoding) of text bytes.

The example app; details

This plugin uses native libraries derived from the universal charset detection libraries created by Mozilla.

Supported platforms

Supported charsets

The detectable charsets differ by platform according to the capabilities of the underlying library; for specifics see:

Usage

import 'package:flutter_charset_detector/flutter_charset_detector.dart';

Uint8List bytes = getBytes(); // bytes with unknown encoding
DecodingResult result = CharsetDetector.autoDecode(bytes);
print(result.charset); // => e.g. 'SHIFT_JIS'
print(result.string); // => e.g. '日本語'

See also