The string `~{` in a UTF8/ASCII document causes detection to fail with `{ encoding: null, confidence: 0 }`.