Skip to content

amake/flutter_charset_detector

Repository files navigation

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

  • Android 4.1 (SDK 16) and higher
  • iOS 11 and higher
  • macOS 10.14 and higher
  • Web (requires TextDecoder support)

Supported charsets

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

Setup

  • Web
  • Others: no special setup required

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

  • charset_converter if you already know the name of the charset you want to encode/decode

About

Flutter plugin that detects the charset (encoding) of text bytes

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy