stripBom method

(String, bool) stripBom(
  1. String input
)

Strip UTF-8 BOM if present. Returns (stripped string, had BOM).

Implementation

(String, bool) stripBom(String input) {
  if (input.isNotEmpty && input.codeUnitAt(0) == _bom) {
    return (input.substring(1), true);
  }
  return (input, false);
}