getByName method Null safety

Encoding? getByName (
  1. String? name

Gets an Encoding object from the name of the character set name. The names used are the IANA official names for the character set (see

The name passed is case insensitive.

If character set is not supported null is returned.


static Encoding? getByName(String? name) {
  if (name == null) return null;
  return _nameToEncoding[name.toLowerCase()];