getCharacterSetName method Null safety

String getCharacterSetName(
  1. CharacterSet? characterSet
)

Retrieves the name of the specified characterSet.

Implementation

static String getCharacterSetName(CharacterSet? characterSet) {
  switch (characterSet) {
    case null:
      return 'utf-8';
    case CharacterSet.utf8:
      return 'utf-8';
    case CharacterSet.ascii:
      return 'ascii';
    case CharacterSet.latin1:
      return 'latin1';
  }
}