utf7 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 64

Provides methods to encode/decode utf-7 strings or adapt the modified base64 for custom methods.

Usage #

A simple usage example:

import 'package:utf7/utf7.dart';

main() {
  // encode/decode strings
  print(Utf7.encode("ûtf-8 chäräctérs")); // +APs-tf-8 ch+AOQ-r+AOQ-ct+AOk-rs
  print(Utf7.decode("+APs-tf-8 ch+AOQ-r+AOQ-ct+AOk-rs")); // ûtf-8 chäräctérs
  // encodeAll additionally encodes characters that could be control characters
  // wherever the encoded string is used
  print(Utf7.encodeAll("A b\r\nc\$")); // A+ACA-b+AA0ACg-c+ACQ-

  // encode/decode modified base64 sequences (the part between + and -)
  print(Utf7.encodeModifiedBase64("û")); // AOQ
  print(Utf7.decodeModifiedBase64("AOQ")); // û

0.2.0 #

  • Encode + as +- instead of +ACs-

0.1.0 #

  • Initial version


import 'package:utf7/utf7.dart';

main() {
  String string = "Tèxt cöntäînîng ûtf-8 chäräctérs";
  String encoded = Utf7.encode(string);
  String strongEncoded = Utf7.encodeAll(string);
  print("UTF-7 representation: $encoded");
  print("UTF-7 representation: $strongEncoded");
  String decoded = Utf7.decode(encoded);
  print("UTF-16 representation: $decoded");

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  utf7: ^0.2.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:utf7/utf7.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Nov 7, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:utf7/utf7.dart.

Health suggestions

Format lib/utf7.dart.

Run dartfmt to format lib/utf7.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
Dev dependencies
pedantic ^1.7.0
test ^1.6.0