Check chardet availability before using it

The use of chardet python library is quite useful in order to detect character encodings, but it's not installed in all systems by default. So, it's a good practice to check its availability before using it.

This pull request enhances #7