flutter_charset_detector
automatically detect and decode the charset (character encoding) of text bytes.
this plugin uses native libraries derived from the universal charset detection
libraries created by mozilla.
- ios: universaldetector2, a
thin wrapper around
uchardet - android:
juniversalchardet, a java
implementation of universalchardet
supported platforms
- android 4.1 (sdk 16) and higher
- ios 9 and higher
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. '日本語'
Comments are closed.