unicode 1.1.8 copy "unicode: ^1.1.8" to clipboard
unicode: ^1.1.8 copied to clipboard

Unicode characters library auto generated from http://www.unicode.org.

example/example.dart

import 'package:unicode/blocks.dart';
import 'package:unicode/unicode.dart' as unicode;

void main(List<String> args) {
  var ch = unicode.toRune('я');
  if (unicode.isLowerCaseLetter(ch)) {
    print('${ch.s} is lowercase letter');
  }

  ch = unicode.toRune('{');
  if (unicode.isOpenPunctuation(ch)) {
    print('${ch.s} is open punctuation');
  }

  ch = unicode.toRune('©');
  if (unicode.isOtherSymbol(ch)) {
    print('${ch.s} is other symbol');
  }

  ch = unicode.toRune('ǁ');
  if (unicode.isOtherLetter(ch)) {
    print('${ch.s} is other letter');
  }

  ch = 'ソ'.c;
  final block = getUnicodeBlock(ch);
  if (block == UnicodeBlock.katakana) {
    print('${ch.s} is katakana');
  }

  ch = unicode.charToTitleCase(unicode.toRune('dž'));
  print('${ch.s} is title case of dž');

  ch = unicode.charToUpperCase(unicode.toRune('dž'));
  print('${ch.s} is upper case of dž');
}

extension on String {
  int get c => unicode.toRune(this);
}

extension on int {
  String get s => String.fromCharCode(this);
}
copied to clipboard
7
likes
150
points
313k
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.19 - 2025.04.03

Unicode characters library auto generated from http://www.unicode.org.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

archive, simple_sparse_list

More

Packages that depend on unicode