normalize static method

String normalize(
  1. String s
)

Normalizes a locale string.

See the Rust documentation for normalize for more information.

Throws LocaleParseError on failure.

Implementation

static String normalize(String s) {
  final temp = _FinalizedArena();
  final write = _Write();
  final result = _icu4x_Locale_normalize_mv1(s._utf8AllocIn(temp.arena), write._ffi);
  if (!result.isOk) {
    throw LocaleParseError.values[result.union.err];
  }
  return write.finalize();
}