utf_ext 0.2.0 copy "utf_ext: ^0.2.0" to clipboard
utf_ext: ^0.2.0 copied to clipboard

A library for reading and writing text files in any major Unicode format (UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE)

example/example.md

How To Use the utf_ext Package

Contents #

  • utf_cat.dart - see how to read UTF files and print to terminal, similar to cat (POSIX) or type (Windows)
  • utf_conv.dart - see how to convert files from one UTF format to another, similar to iconv (POSIX)

Sample code #

import 'package:file/file.dart';
...
final data = await filterByPrefixAndToUpperCase('example.md', '-');
...
Future<List<String>> filterByPrefixAndToUpperCase(FileSystem fs, String filePath, String prefix) async {
  final pileup = <String>[];

  await fs.file(filePath).readUtfAsLines(pileup: pileup, onRead: (param) {
    final line = param.current!;

    if (!line.startsWith(prefix)) {
      return VisitResult.skip;
    }

    param.current = line.toUpperCase();

    return VisitResult.take;
  });

  return pileup;
}
1
likes
0
pub points
52%
popularity

Publisher

verified publisheraiurovet.com

A library for reading and writing text files in any major Unicode format (UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE)

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

async, file, loop_visitor

More

Packages that depend on utf_ext