パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.7.1

enough_convert

`dart:convert` に文字エンコーディング / キャラクタセット / コードックのサポートが欠けている - ISO 8859 / ラテン、Windows、DOS、GBK、Big5、および KOI8 R/U。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
5.2万
いいね数
25
Pub ポイント
150

パッケージをインストール

flutter pub add enough_convert

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Enough Convert は、Dart の組み込み `dart:convert` を拡張し、ISO 8859、Windows、DOS、GBK、Big5、KOI8 R/U などの追加文字エンコーディングをサポートします。国際化アプリケーションでよく使われるレガシーおよび非 UTF-8 テキスト形式の処理におけるギャップを埋めます。古いシステムや地域固有のエンコーディングでのテキストのパースまたは生成に最適であり、このパッケージにより、さまざまな環境間で正確なデータ処理が保証されます。

用途

  • 非UTF-8エンコーディングを使用するレガシーテキストファイルの解析
  • 地域の文字セットにおける多言語コンテンツの取り扱い
  • デスクトップおよびモバイルアプリケーション間で異なるコードページを変換する
  • DOS や Windows のエンコーディングを使用して、古いシステムからのデータを処理する
  • 国際化アプリケーションにおける東アジアテキスト(GBK、Big5)のサポート
  • キリル文字(KOI8-R/U)の正しく表示を確認する

主な機能

  • ISO 8859、Windows、DOS、GBK、Big5、KOI8 エンコーディングをサポートしています
  • 軽量で、すべてのFlutterプラットフォームと互換性があります
  • `dart:convert` を拡張するシンプルな API
  • 外部の依存関係なし
  • レガシー形式の正確なエンコード/デコード
  • クロスプラットフォームの一貫性

適している対象

  • レガシーデータソースと連携する開発者
  • 多言語テキストサポートを必要とするアプリ
  • 東アジアまたはキリル文字セットを含むプロジェクト
  • コードページ変換が必要なモバイルおよびデスクトップアプリ
  • 非UTF-8コンテンツを扱う国際化チーム

注意事項

  • UTF-8専用のワークフローには不要
  • 特定のレガシーエンコーディングに限定
  • ターゲットエンコーディング規格に関する知識が必要になる場合があります
  • 大規模な変換ではパフォーマンスへの影響はわずかだが存在する
  • 既知のUTF-8以外の入出力と取り扱う際に最適です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Support for character encodings / charsets / codecs missing from dart:convert.

Supports the following encodings:

  • Latin / ISO 8859 encodings:
    • Latin 1 / ISO 8859-1
    • Latin 2 / ISO 8859-2
    • Latin 3 / ISO 8859-3
    • Latin 4 / ISO 8859-4
    • Latin 5 / ISO 8859-5
    • Latin 6 / ISO 8859-6
    • Latin 7 / ISO 8859-7
    • Latin 8 / ISO 8859-8
    • Latin 9 / ISO 8859-9
    • Latin 10 / ISO 8859-10
    • Latin 11 / ISO 8859-11
    • Latin 13 / ISO 8859-13
    • Latin 14 / ISO 8859-14
    • Latin 15 / ISO 8859-15
    • Latin 16 / ISO 8859-16
  • Windows Codepage Encodings:
    • Windows-1250 / cp-1250
    • Windows-1251 / cp-1251
    • Windows-1252 / cp-1252
    • Windows-1253 / cp-1253
    • Windows-1254 / cp-1254
    • Windows-1255 / cp-1255
    • Windows-1256 / cp-1256
  • DOS Codepage Encodings:
    • cp-850
  • GBK (compatible with GB-2312)
  • KOI8
    • KOI8-R
    • KOI8-U
  • Big5

Usage

Using enough_convert is pretty straight forward:

import 'package:enough_convert/enough_convert.dart';

main() {
  final codec = const Windows1252Codec(allowInvalid: false);
  final input = 'Il faut être bête quand même.';
  final encoded = codec.encode(input);
  final decoded = codec.decode([...encoded]);
  print('${codec.name}: encode "$input" to "$encoded"');
  print('${codec.name}: decode $encoded to "$decoded"');

}

Installation

Add this dependency your pubspec.yaml file:

dependencies:
  enough_convert: ^1.6.0

The latest version or enough_convert is enough_convert version.

Wait, what is this about?

Dylan (not associated with this project in any way) explains the world of text encoding quite well: Plain text? Really?

It's 2022, do we still need this?

Short answer: yes.

Long answer: yes, there are still many web pages, emails and other content out there that is encoded in various text encodings.

Features and bugs

Please file feature requests and bugs at the issue tracker.

Null-Safety

enough_convert is null-safe from v1.0.0 onward.

License

enough_convert is licensed under the commercial friendly Mozilla Public License 2.0

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト