Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unorm_dart package #3109

Open
chrisbobbe opened this issue Dec 18, 2024 · 0 comments
Open

Add unorm_dart package #3109

chrisbobbe opened this issue Dec 18, 2024 · 0 comments

Comments

@chrisbobbe
Copy link

https://pub.dev/packages/unorm_dart

This module exports four functions: nfc, nfd, nfkc, and nfkd; one for each Unicode normalization

It would be very convenient if I could copy-paste into DartPad and run some sample code from the README:

import "package:unorm_dart/unorm_dart.dart" as unorm;

void main() {
  var text = "The \u212B symbol invented by A. J. \u00C5ngstr\u00F6m " +
      "(1814, L\u00F6gd\u00F6, \u2013 1874) denotes the length " +
      "10\u207B\u00B9\u2070 m.";

  var combining = RegExp(r"[\u0300-\u036F]/g");

  print("Regular:  ${text}");
  print("NFC:      ${unorm.nfc(text)}");
  print("NFKC:     ${unorm.nfkc(text)}");
  print("NFKD: *   ${unorm.nfkd(text).replaceAll(combining, "")}");
  print(" * = Combining characters removed from decomposed form.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant