diagnostics: Check for chardet dependency

Fixes #1719