Add scripts to find and fix magic encoding comment issues.

A Rspec example is also added to ensure no files miss the magic encoding
comment.

The scripts only check the file containing non-ascii characters.

Closes #522