isLatinLetter static method

bool isLatinLetter(
  1. String character
)

Implementation

static bool isLatinLetter(String character) {
  final RegExp latinLettersPattern =
      RegExp(r'\p{Script=Latin}', unicode: true);
  final bool isLatinScript = latinLettersPattern.hasMatch(character);

  final RegExp nonSpacingMarkRegex = RegExp(r'\p{Mn}', unicode: true);
  final bool isNonSpacingMark = nonSpacingMarkRegex.hasMatch(character);

  return isLatinScript || isNonSpacingMark;
}